WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 5 years ago

#10475 closed defect (bug) (duplicate)

wp-blog-header.php wiping out $_REQUEST array

Reported by: mitchkramez Owned by:
Milestone: Priority: high
Severity: normal Version: 2.8.1
Component: General Keywords: REQUEST, wp-blog-header
Focuses: Cc:

Description

I'm not sure when this started happening, but i'm guessing 2.8... i've confirmed this with 2.8.1 and 2.8.2:

<?
$_POST['postvar'] = 1;
$_REQUEST['testvar1'] = 1;
$_REQUEST['testvar2'] = 1;
$_REQUEST['testvar3'] = 1;
require_once($_SERVER['DOCUMENT_ROOT'].'/wp-blog-header.php');
?>
<pre><? print_r($_REQUEST) ?></pre>
<pre><? print_r($_POST) ?></pre>

if you do try this you'll see your request array is blank after the require... It seems to me this is a bug. If you need to use wp functions outside of wp, you need to include the wp-blog-header.php file... and with custom url rewriting for the other non wp parts of the site storing variables in the request array. If you pass the variable in on the query string it works fine.

Change History (2)

comment:1 mitchkramez5 years ago

here's the result with the require commented out:

Array
(
    [handle] => 1
    [MintUnique] => 1
    [kramez-shoutbox-name] => mitch
    [wp-settings-time-1] => 1243301960
    [wp-settings-1] => m0=c&m1=o&m2=c&m3=c&m4=c&m5=o&m6=c&m7=c&m8=c&m9=c&m10=c&mfold=f&editor=html&imgsize=full
    [wp-settings-time-0] => 1228958321
    [MintAuth] => 15ecb76a151e77be34b11a2ebd8f0fd7
    [testvar1] => 1
    [testvar2] => 1
    [testvar3] => 1
)

Array
(
    [postvar] => 1
)

here's the result with the require in place:

Array
(
    [handle] => 1
    [postvar] => 1
)

Array
(
    [postvar] => 1
)

comment:2 Denis-de-Bernardy5 years ago

  • Milestone Unassigned deleted
  • Resolution set to duplicate
  • Status changed from new to closed

see #10360

Note: See TracTickets for help on using tickets.