Here is a quick script to change all the php files if you point $basepath to the forum root (place this script outside of the forum root for obvious reasons)
As of now (vb4.2.0 PL3) this has still not been addressed.
PHP Code:
<?php
$basepath = "/var/www";
function cycledir($dirname) {
$handle = opendir($dirname);
if (!$handle) {
echo "WARN: $dirname could not be opened!\n";
return;
}
$dirname .= '/';
while (false !== ($file = readdir($handle))) {
if ($file{0} != '.') {
if (is_file($dirname.$file) && substr($file,-3) == 'php') {
$raw = file_get_contents($dirname.$file);
$new = str_replace("error_reporting(E_ALL & ~E_NOTICE)", "error_reporting(E_ALL & ~E_NOTICE & ~8192 & ~2048 & ~E_WARNING)", $raw);
file_put_contents($dirname.$file, $new);
echo $raw == $new ? "wrote ".$dirname.$file."\n" : "no changes: ".$dirname.$file."\n";
} elseif (is_dir($dirname.$file)) {
cycledir($dirname.$file);
}
}
}
}
cycledir($basepath);
echo "OK\n";
?>
Leave a comment: