BUG 9226 gulliver propel-build-sql script needs user and pass

- the script propel-build-sql was using mysql_real_escape_string, and this function needs to connect to database in order to make a good and real escape
needs
- the function mysql_real_escape string was changed for a simple alternative, and this code does not need to connect to database.
This commit is contained in:
Fernando Ontiveros
2012-06-14 16:55:30 -04:00
parent 1899262440
commit 0367268c4f

View File

@@ -92,7 +92,10 @@ class MysqlPlatform extends DefaultPlatform {
* @return string
*/
public function escapeText($text) {
return mysql_real_escape_string($text);
$search = array("\x00", "\n", "\r", "\\", "'", "\"", "\x1a");
$replace = array("\\x00", "\\n", "\\r", "\\\\" ,"\'", "\\\"", "\\\x1a");
return str_replace($search, $replace, $text);
//return mysql_real_escape_string($text);
}
/**