LotGDocker/lotgd-web/lotgd/lib/safeescape.php
2020-08-17 19:16:42 -04:00

19 lines
312 B
PHP
Executable File

<?php
// addnews ready
// translator ready
// mail ready
function safeescape($input){
$prevchar="";
$out="";
for ($x=0;$x<strlen($input);$x++){
$char = substr($input,$x,1);
if (($char=="'" || $char=='"') && $prevchar!="\\"){
$char="\\$char";
}
$out.=$char;
$prevchar=$char;
}
return $out;
}
?>