Wired error of isset() in many wp-admin\*.php
-
I’ve install newest WordPress to my new shared-hosing (v 5.0.4 , safe mode = On , regester_globels = Off ) , but all the FORMs in admin CPanel dosn’t work. Pages are displayed very nice, no database error, no any error , but i just can’t edit posts/pages/options. In one word, i can do _noting_ to change WP.
I checked the code , and found that in these pages:
[quote]
wp-admin\admin.php:27: if (!isset($$wpvar)) {
wp-admin\categories.php:10: if (!isset($$wpvar)) {
wp-admin\import-blogger.php:6: if (!isset($$wpvar)) {
wp-admin\import-greymatter.php:10: if (!isset($$wpvar)) {
wp-admin\link-add.php:47: if (!isset($$wpvar)) {
wp-admin\link-categories.php:12: if (!isset($$wpvar)) {
wp-admin\link-manager.php:50: if (!isset($$wpvar)) {
wp-admin\moderation.php:10: if (!isset($$wpvar)) {
wp-admin\options-head.php:6: if (!isset($$wpvar)) {
wp-admin\options.php:11: if (!isset($$wpvar)) {
wp-admin\plugin-editor.php:10: if (!isset($$wpvar)) {
wp-admin\post.php:12: if (!isset($$wpvar)) {
wp-admin\profile.php:10: if (!isset($$wpvar)) {
wp-admin\templates.php:9: if (!isset($$wpvar)) {
wp-admin\theme-editor.php:10: if (!isset($$wpvar)) {
wp-admin\user-edit.php:11: if (!isset($$wpvar)) {
wp-admin\users.php:10: if (!isset($$wpvar)) {
wp-blog-header.php:94: if (!isset($$wpvar)) {
wp-register.php:7: if (!isset($$wpvar)) {[/quote]
use the same codes to deal with register_global = off problems:
[code]
// code from wp-admin/post.php
$wpvarstoreset = array('action', 'safe_mode', 'withcomments', 'posts', 'content', 'edited_post_title', 'comment_error', 'profile', 'trackback_url', 'excerpt', 'showcomments', 'commentstart', 'commentend', 'commentorder' );
for ($i=0; $i<count($wpvarstoreset); $i += 1) {
$wpvar = $wpvarstoreset[$i];
if (!isset($$wpvar)) {
if (empty($_POST["$wpvar"])) {
if (empty($_GET["$wpvar"])) {
$$wpvar = '';
} else {
$$wpvar = $_GET["$wpvar"];
}
} else {
$$wpvar = $_POST["$wpvar"];
}
}
}[/code]
it’s very weired that in each loop, the isset($$wpvar) return TRUE, that mean all these vars has already be defined, but that’s impossible. so i changed this line
[code] if (!isset($$wpvar)) { [/code]
to
[code]if (array_key_exists($$wpvar, get_defined_vars()) == false) { [/code]
then, all the problems solved ( but cost more excuted time ?? ) .
so i’m just wandering why the $$wpvar can’t not be found in the array of all defined vars, but isset($$wpvar) return true.
and the wirest thing is that WP runs very well in my localhost, i mean my PC@home, it just didn’t run well on my shared-hosting.
- The topic ‘Wired error of isset() in many wp-admin\*.php’ is closed to new replies.