Fixed a postgresql bug in the File namespace (reported by phirox - thanks)
authorDan Fuhry <dan@enanocms.org>
Wed, 29 Dec 2010 13:23:58 -0500
changeset 1331 c7d6317c5e82
parent 1330 1649f687e69e
child 1332 12286b3ee214
Fixed a postgresql bug in the File namespace (reported by phirox - thanks)
includes/namespaces/file.php
--- 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)) .
 							  "(\\\\||\\\\])';");