[wp-trac] [WordPress Trac] #10475: wp-blog-header.php wiping out $_REQUEST array

WordPress Trac wp-trac at lists.automattic.com
Fri Jul 24 17:16:51 UTC 2009


#10475: wp-blog-header.php wiping out $_REQUEST array
--------------------------+-------------------------------------------------
 Reporter:  mitchkramez   |       Owner:                         
     Type:  defect (bug)  |      Status:  new                    
 Priority:  high          |   Milestone:  Unassigned             
Component:  General       |     Version:  2.8.1                  
 Severity:  normal        |    Keywords:  REQUEST, wp-blog-header
--------------------------+-------------------------------------------------
 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.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/10475>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list