That the installation on the PHP server will be $ _REQUEST empty?

I am developing a WordPress site on my local machine and hosting on my own server. Everything works perfectly.

After switching to the client server, some functions in the editor stopped working. In particular, those related to ajax requests. I looked through things and it exited with die(0) in admin-ajax.php using the following code:

 // Require an action parameter if ( empty( $_REQUEST['action'] ) ) die( '0' ); 

further reading sees $_REQUEST as reset during wp_magic_quotes() in wp-includes/load.php as follows:

 $_REQUEST = array_merge( $_GET, $_POST ); 

What could be the problem with installing PHP on the server, which could make $_REQUEST empty after wp_magic_quotes() during ajax-admin.php ?

If I edit ajax-admin.php to add $_REQUEST reset:

 $_REQUEST = array_merge( $_GET, $_POST ); // Require an action parameter if ( empty( $_REQUEST['action'] ) ) die( '0' ); 

... then all ajax in the editor works as it should.

But I would prefer not to edit the main files, so I would like to know how I can change the server settings to make everything work with standard files?

Installation Details:
Wordpress 3.4.2
PHP 5.4.5 using Apache 2.0 handler
Unix server

PHP settings:
request_order: no value
variables_order: GPCS

Any help was appreciated.

Thanks,
matte

+4
source share
2 answers

Check your php.ini configuration. There is a request_order option, which should be set to "On", and the value is "GP" for Get and Post.

He turned off. But here is what mine looks like on my local ini from WAMP.

 ; request_order ; Default Value: None ; Development Value: "GP" ; Production Value: "GP" 
0
source

Source: https://habr.com/ru/post/1440543/


All Articles