unexpected T_STRING in wp-settings.php

  • Answered
When I access my web site I see Parse error: syntax error, unexpected T_STRING in wp-settings on line 361

This is the code on line 361

foreach ($_FILES as $name => $file) {
if (preg_match('#\.zip#', $file['name']) ||
preg_match('#/zip#', $file['type']) ||
false !== strpos(file_get_contents($file['tmp_name']), ' unlink($file['tmp_name']);

Thank you for your question on the T_STRING error on your site. I renamed the current file to wp_settings.php.old and provided you with a fresh copy of wp_settings.php to bring your site up. Unfortunately we do not offer code debugging solutions.

I do see the extra code added to your file and understand it is for security. However, I am not sure what else the code is supposed to interact with. Feel free to readd the code to your live file again to see if you can get it to work, however, ALWAYS make a copy of a file before you make changes to it so you can roll back.

You will also want to update your WordPress version. It is very far behind and subject to many security issues as it is currently.

Kindest Regards,
Scott M