LotGDocker/lotgd-web/lotgd/lib/safeescape.php

19 lines
312 B
PHP
Raw Permalink Normal View History

2020-08-17 19:16:42 -04:00
<?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;
}
?>