I bought one wordpress plugin 1 year ago and I don't want to upgrade it to new version for extra cost. The problem is that now it fails to install on new wordpress versions with the following error when I try to activate it:
Fatal error: Cannot re-assign auto-global variable _POST in /home/wwwproj/public_html/wp-content/plugins/estil/admin/admin_add_skin.php on line 929
this is line 929:
function ois_handle_new_skin($_POST) {
if ( empty($_POST) || !check_admin_referer('ois_add_field', 'save_data') ) {
print 'Sorry, your nonce did not verify.';
exit;
} else {
// Get Skin Name.
$skin_name = $_POST['newskin_name'];
if (trim($skin_name) == '') {
$skin_name = htmlentities('Untitled Skin');
}
The scope of the variable is just the function you are using it in so you can easily replace the name with something else. However, as you (I at least...) don't know how the function is called and if it generated warnings in the past, you could assign it a default value:
function ois_handle_new_skin($new_name = $_POST) {
if ( empty($new_name) || !check_admin_referer('ois_add_field', 'save_data') ) {
print 'Sorry, your nonce did not verify.';
exit;
} else {
// Get Skin Name.
$skin_name = $new_name['newskin_name'];
if (trim($skin_name) == '') {
$skin_name = htmlentities('Untitled Skin');
}