Changed the stripslashes to sql_escape and added this function to mysql_connection.class.php
parent
1fa054c489
commit
5443919c6f
|
|
@ -350,18 +350,6 @@ if(!defined('entry') || !entry) die('Not a valid page');
|
||||||
return $dirs;
|
return $dirs;
|
||||||
}
|
}
|
||||||
|
|
||||||
function sql_escape($value) {
|
|
||||||
if(get_magic_quotes_gpc()) {
|
|
||||||
$value = stripslashes($value);
|
|
||||||
}
|
|
||||||
if( function_exists("mysql_real_escape_string")) {
|
|
||||||
$value = mysql_real_escape_string($value);
|
|
||||||
} else {
|
|
||||||
$value = addslashes($value);
|
|
||||||
}
|
|
||||||
return $value;
|
|
||||||
}
|
|
||||||
|
|
||||||
function removeBadTags($source) {
|
function removeBadTags($source) {
|
||||||
$validTags ='<p><ol><ul><li><a><abbr><acronym><blockquote><code><pre><em><i><strike><s><strong><b><br><span><div><img>';
|
$validTags ='<p><ol><ul><li><a><abbr><acronym><blockquote><code><pre><em><i><strike><s><strong><b><br><span><div><img>';
|
||||||
$source = strip_tags($source, $validTags);
|
$source = strip_tags($source, $validTags);
|
||||||
|
|
|
||||||
|
|
@ -115,13 +115,10 @@ class Conexion_Mysql {
|
||||||
}
|
}
|
||||||
elseif (substr_count(MYSQL_TYPES_DATE, "$tipo_col ")) {
|
elseif (substr_count(MYSQL_TYPES_DATE, "$tipo_col ")) {
|
||||||
$valor = $this->formatearFecha($valor, $tipo_col); // formatea las fechas
|
$valor = $this->formatearFecha($valor, $tipo_col); // formatea las fechas
|
||||||
|
|
||||||
$sqlValues .= "'$valor',";
|
$sqlValues .= "'$valor',";
|
||||||
}
|
}
|
||||||
elseif (substr_count(MYSQL_TYPES_STRING, "$tipo_col ")) {
|
elseif (substr_count(MYSQL_TYPES_STRING, "$tipo_col ")) {
|
||||||
if ($this->auto_slashes) {
|
$valor = $this->sql_escape($valor);
|
||||||
$valor = addslashes($valor);
|
|
||||||
}
|
|
||||||
$sqlValues .= "'$valor',";
|
$sqlValues .= "'$valor',";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -171,9 +168,7 @@ class Conexion_Mysql {
|
||||||
$sql .= "'$valor',";
|
$sql .= "'$valor',";
|
||||||
}
|
}
|
||||||
elseif (substr_count(MYSQL_TYPES_STRING, "$tipo_col ")) {
|
elseif (substr_count(MYSQL_TYPES_STRING, "$tipo_col ")) {
|
||||||
if ($this->auto_slashes) {
|
$valor = $this->sql_escape($valor);
|
||||||
$valor = addslashes($valor);
|
|
||||||
}
|
|
||||||
$sql .= "'$valor',";
|
$sql .= "'$valor',";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -229,7 +224,6 @@ class Conexion_Mysql {
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Obtiene el registro obtenido de una consulta.
|
* Obtiene el registro obtenido de una consulta.
|
||||||
*/
|
*/
|
||||||
|
|
@ -285,5 +279,16 @@ class Conexion_Mysql {
|
||||||
mysql_free_result($this->mid_consulta);
|
mysql_free_result($this->mid_consulta);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function sql_escape($value) {
|
||||||
|
if(get_magic_quotes_gpc()) {
|
||||||
|
$value = stripslashes($value);
|
||||||
|
}
|
||||||
|
if( function_exists("mysql_real_escape_string")) {
|
||||||
|
$value = mysql_real_escape_string($value);
|
||||||
|
} else {
|
||||||
|
$value = addslashes($value);
|
||||||
|
}
|
||||||
|
return $value;
|
||||||
|
}
|
||||||
} //fin de la Clase conexion_mysql
|
} //fin de la Clase conexion_mysql
|
||||||
?>
|
?>
|
||||||
Loading…
Reference in New Issue