Opened 14 years ago
Closed 14 years ago
#10475 closed defect (bug) (duplicate)
wp-blog-header.php wiping out $_REQUEST array
Reported by: |
|
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)
Note: See
TracTickets for help on using
tickets.
here's the result with the require commented out:
here's the result with the require in place: