• Resolved Malcolm

    (@parkendplayers)


    With PHP debug enabled I when I use the Upload Images button on the Upload Images tab of the Add Gallery/Images page, having previously selected one or more files to upload, I get the following error:

    Undefined offset: 1 in {WebRoot}\wp-includes\vars.php on line 19

    The error is repeated for each file uploaded.

    It appears that setting WP_ADMIN to true in upload.php forces vars.php to parse the path of the current page assuming that it is in the wp-admin subfolder. Because upload.php is not in wp-admin the call to preg_match() in vars.php fails, the $self_matches array is not generated and an error is generated. As a consequence $pagenow is not set to the current page.

    Removing the define(‘WP_ADMIN’, true) line from upload.php fixed the error, and as far as I could tell the code continued to function correctly. I’m completely new to WordPress, so am completely at a loss what the side effects are of setting WP_ADMIN to false on what is in effect an admin page.

  • The topic ‘[Plugin: NextGen Gallery] 1.6.2 Bug and Fix. Undefined offset: 1 vars.php’ is closed to new replies.