sql_quote

databind
vitalif 2011-01-03 00:06:34 +00:00 committed by Vitaliy Filippov
parent c5a92c67e9
commit eb9045878e
1 changed files with 4 additions and 0 deletions

View File

@ -841,6 +841,10 @@ $iset";
function function_addslashes($e) { return "str_replace(array(\"\\n\",\"\\r\"),array(\"\\\\n\",\"\\\\r\"),addslashes($e))"; }
function function_q($e) { return "str_replace(array(\"\\n\",\"\\r\"),array(\"\\\\n\",\"\\\\r\"),addslashes($e))"; }
/* экранирование кавычек в SQL- или CSV- стиле (кавычка " превращается в двойную кавычку "") */
function function_sq($e) { return "str_replace('\"','\"\"',$e)"; }
function function_sql_quote($e) { return "str_replace('\"','\"\"',$e)"; }
/* преобразование символов <>&'" в HTML-сущности &lt; &gt; &amp; &apos; &quot; */
function function_htmlspecialchars($e) { return "htmlspecialchars($e,ENT_QUOTES)"; }
function function_html($e) { return "htmlspecialchars($e,ENT_QUOTES)"; }