php/apache update and code broke
سؤال
Some server info: Apache version WAS Apache 2.2.26 NOW IS Apache 2.4.7
PHP version WAS 5.3.28 ( DEPRECATED ) NOW IS 5.4.25
after the update a plugin used something like this:
$args['headers']['X-WP-Domain'] = self::domain();
and then
$request = wp_remote_request( $url, $args );
on the request url we have something like:
if ( $wp->query_vars['wpec'] != 'notification' && ( empty( $_SERVER['HTTP_X_WP_DOMAIN'] ) || $_SERVER['HTTP_X_WP_DOMAIN'] != home_url() ) ) {
throw new Exception( 'Invalid domain', 500 );
}
$wp->query_vars['wpec'] will be = purchase so first clause is right. but somehow that if clause is throwing us the error 500 Invalid domain.
X-WP-Domain is set as you can see and it does match home_url() so the && clause is met too
لا يوجد حل صحيح
لا تنتمي إلى StackOverflow