Permalink
Browse files

Merge branch 'MDL-13331_m19' of git://github.com/nebgor/moodle into M…

…OODLE_19_STABLE
  • Loading branch information...
2 parents 4ae7426 + 0693cb2 commit b094ce466b052ead4e31020f2af0e891cdd96a16 Sam Hemelryk committed Aug 28, 2011
Showing with 7 additions and 2 deletions.
  1. +7 −2 search/lib.php
View
@@ -151,11 +151,16 @@ function search_shorten_url($url, $length=30) {
* @return the escaped string
*/
function search_escape_string($str) {
- global $CFG;
+ global $CFG, $db;
switch ($CFG->dbfamily) {
case 'mysql':
- $s = mysql_real_escape_string($str);
+ if ($CFG->dbtype == 'mysqli') {
+ //ugly hack for 1.9 stable ONLY to get it to work for mysqli.
+ $s = mysqli_real_escape_string($db->_connectionID, $str);
+ } else {
+ $s = mysql_real_escape_string($str);
+ }
break;
case 'postgres':
$s = pg_escape_string($str);

0 comments on commit b094ce4

Please sign in to comment.