Project

General

Profile

Bug #23557 » 15737_45.patch

Administrator Admin, 2010-12-09 20:20

View differences:

t3lib/class.t3lib_db.php (Arbeitskopie)
);
}
}
$this->setSqlMode();
}
return $this->link;
}
/**
* Fixes the SQL mode by unsetting NO_BACKSLASH_ESCAPES if found.
*
* @return void
*/
protected function setSqlMode() {
$resource = $this->sql_query('SELECT @@SESSION.sql_mode;');
if (is_resource($resource)) {
$result = $this->sql_fetch_row($resource);
if (isset($result[0]) && $result[0] && strpos($result[0], 'NO_BACKSLASH_ESCAPES') !== FALSE) {
$modes = array_diff(
t3lib_div::trimExplode(',', $result[0]),
array('NO_BACKSLASH_ESCAPES')
);
$query = 'SET sql_mode=\'' . mysql_real_escape_string(implode(',', $modes)) . '\';';
$success = $this->sql_query($query);
t3lib_div::sysLog(
'NO_BACKSLASH_ESCAPES could not be removed from SQL mode: ' . $this->sql_error(),
'Core',
3
);
}
}
}
/**
* Select a MySQL database
* mysql_select_db() wrapper function
* Usage count/core: 8
(4-4/4)