Analysis task should look for a git commit based on abridged hashes
[WebKit-https.git] / Websites / perf.webkit.org / public / include / commit-log-fetcher.php
index 4ec6e1cec54b28e6dcd83d917475511ba7b4e3fb..0bb73fb9d56fb6bd2cf183e666d306c4c1334a31 100644 (file)
@@ -65,7 +65,7 @@ class CommitLogFetcher {
         }
 
         if ($keyword) {
-            array_push($values, '%' . str_replace(array('\\', '_', '%'), array('\\\\', '\\_', '\\%'), $keyword) . '%');
+            array_push($values, '%' . Database::escape_for_like($keyword) . '%');
             $keyword_index = '$' . count($values);
             array_push($values, ltrim($keyword, 'r'));
             $revision_index = '$' . count($values);
@@ -112,7 +112,7 @@ class CommitLogFetcher {
 
     private function format_single_commit($commit_row) {
         $committer = $this->db->select_first_row('committers', 'committer', array('id' => $commit_row['commit_committer']));
-        return $this->format_commit($commit_row, $committer);
+        return array($this->format_commit($commit_row, $committer));
     }
 
     private function format_commit($commit_row, $committer_row) {