includes/namespaces/file.php
changeset 1331 c7d6317c5e82
parent 1309 2a14b5a25338
--- a/includes/namespaces/file.php	Wed Dec 29 13:22:39 2010 -0500
+++ b/includes/namespaces/file.php	Wed Dec 29 13:23:58 2010 -0500
@@ -189,10 +189,11 @@
 		}
 		$db->free_result();
 		$html .= '<h3>' . $lang->get('onpage_filebox_lbl_pagesusing') . '</h3>';
+		$regexp = ENANO_DBLAYER == 'PGSQL' ? '~ E' : 'REGEXP ';
 		$q = $db->sql_query('SELECT t.page_id, t.namespace, p.name FROM ' . table_prefix . "page_text AS t\n"
 			              . "  LEFT JOIN " . table_prefix . "pages AS p\n"
 			              . "    ON ( t.page_id = p.urlname AND t.namespace = p.namespace )\n"
-			              . "  WHERE t.page_text REGEXP '\\\\[\\\\[:" .
+			              . "  WHERE t.page_text {$regexp}'\\\\[\\\\[:" .
 							  addslashes(preg_quote($paths->nslist[$this->namespace])) .
 							  addslashes(preg_quote($this->page_id)) .
 							  "(\\\\||\\\\])';");