Analysis task should look for a git commit based on abridged hashes
[WebKit-https.git] / Websites / perf.webkit.org / public / include / db.php
index 8749be0c9270c31ae6a0085850f9c5ae670b7c20..1cc3278196126c7794dd201050d74e3660c9a760 100644 (file)
@@ -84,6 +84,10 @@ class Database
         return intval($timestamp_in_s * 1000);
     }
 
+    static function escape_for_like($string) {
+        return str_replace(array('\\', '_', '%'), array('\\\\', '\\_', '\\%'), $string);
+    }
+
     function connect() {
         $databaseConfig = config('database');
         $this->connection = @pg_connect('host=' . $databaseConfig['host'] . ' port=' . $databaseConfig['port']