includes/namespaces/file.php
changeset 1331 c7d6317c5e82
parent 1309 2a14b5a25338
equal deleted inserted replaced
1330:1649f687e69e 1331:c7d6317c5e82
   187 			}
   187 			}
   188 			$html .= '</p>';
   188 			$html .= '</p>';
   189 		}
   189 		}
   190 		$db->free_result();
   190 		$db->free_result();
   191 		$html .= '<h3>' . $lang->get('onpage_filebox_lbl_pagesusing') . '</h3>';
   191 		$html .= '<h3>' . $lang->get('onpage_filebox_lbl_pagesusing') . '</h3>';
       
   192 		$regexp = ENANO_DBLAYER == 'PGSQL' ? '~ E' : 'REGEXP ';
   192 		$q = $db->sql_query('SELECT t.page_id, t.namespace, p.name FROM ' . table_prefix . "page_text AS t\n"
   193 		$q = $db->sql_query('SELECT t.page_id, t.namespace, p.name FROM ' . table_prefix . "page_text AS t\n"
   193 			              . "  LEFT JOIN " . table_prefix . "pages AS p\n"
   194 			              . "  LEFT JOIN " . table_prefix . "pages AS p\n"
   194 			              . "    ON ( t.page_id = p.urlname AND t.namespace = p.namespace )\n"
   195 			              . "    ON ( t.page_id = p.urlname AND t.namespace = p.namespace )\n"
   195 			              . "  WHERE t.page_text REGEXP '\\\\[\\\\[:" .
   196 			              . "  WHERE t.page_text {$regexp}'\\\\[\\\\[:" .
   196 							  addslashes(preg_quote($paths->nslist[$this->namespace])) .
   197 							  addslashes(preg_quote($paths->nslist[$this->namespace])) .
   197 							  addslashes(preg_quote($this->page_id)) .
   198 							  addslashes(preg_quote($this->page_id)) .
   198 							  "(\\\\||\\\\])';");
   199 							  "(\\\\||\\\\])';");
   199 		if ( !$q )
   200 		if ( !$q )
   200 			$db->_die();
   201 			$db->_die();