Webshell defense

git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@10672 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
ovclas 2012-05-11 09:35:07 +00:00
parent 4d4b66d0d2
commit 1aa87a3442

View file

@ -146,6 +146,10 @@
$buff = '<?php if(!defined("__ZBXE__")) exit();'."\n";
foreach($ftp_info as $key => $val) {
if(!$val) continue;
if(preg_match('/(<\?|<\?php|\?>)/xsm', preg_replace('/\s/', '', $val)))
{
continue;
}
$buff .= sprintf("\$ftp_info->%s = '%s';\n", $key, str_replace("'","\\'",$val));
}
$buff .= "?>";