Changeset 2691
- Timestamp:
- 5/25/2012 2:25:13 AM (12 months ago)
- File:
-
- 1 edited
-
trunk/website/scripts/blackbox/upload.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/website/scripts/blackbox/upload.php
r2690 r2691 63 63 } 64 64 65 function GetReportIDFromExceptionIDs(array $exceptionIDs) 66 { 67 $ids = implode(', ', $exceptionIDs); 68 $pdo = new Database(); 69 $result = $pdo->query(sprintf('SELECT ReportID, COUNT(ID) as Matches FROM blackbox_exceptions 70 WHERE ID IN (%s) GROUP BY ReportID ORDER BY Matches DESC', $ids)); 71 72 if ($result->rowCount() > 0) 73 { 74 $row = $result->fetch(); 75 return $row['ReportID']; 76 } 77 78 return null; 79 } 80 65 81 function QueryStatus($stackTrace) 66 82 { … … 68 84 $reportID = false; 69 85 $exceptionIDs = array(); 70 $pdo = new Database();71 86 72 87 foreach ($stackTrace as $exceptionDepth => $exception) … … 90 105 if ($status == 'exists' && count($exceptionIDs) > 0) 91 106 { 92 $ids = implode(', ', $exceptionIDs); 93 $result = $pdo->query(sprintf('SELECT ReportID, COUNT(ID) as Matches FROM blackbox_exceptions 94 WHERE ID IN (%s) GROUP BY ReportID ORDER BY Matches DESC', $ids)); 95 if ($result->rowCount() > 0) 96 { 97 $row = $result->fetch(); 98 $reportID = $row['ReportID']; 99 107 $reportID = GetReportIDFromExceptionIDs($exceptionIDs); 108 if ($reportID !== null) 109 { 100 110 printf('<?xml version="1.0"?> 101 111 <crashReport status="exists" id="%s" />', htmlspecialchars($status), $reportID);
Note: See TracChangeset
for help on using the changeset viewer.
