Fixed PHPCompatibility issues

Closes #17625
This commit is contained in:
Claudio Sanches 2017-11-09 16:36:29 -02:00
parent 3062dba4e5
commit 22232f29c7
5 changed files with 11 additions and 5 deletions

View File

@ -171,7 +171,7 @@ $untested_plugins = $plugin_updates->get_untested_plugins( WC()->version, 'minor
if ( $wpdb->use_mysqli ) {
$ver = mysqli_get_server_info( $wpdb->dbh );
} else {
$ver = mysql_get_server_info();
$ver = mysql_get_server_info(); // @codingStandardsIgnoreLine
}
if ( ! empty( $wpdb->is_mysql ) && ! stristr( $ver, 'MariaDB' ) ) : ?>
<tr>

View File

@ -619,7 +619,8 @@ class WC_API_Server {
* @return string
*/
public function get_raw_data() {
// $HTTP_RAW_POST_DATA is deprecated on PHP 5.6
// @codingStandardsIgnoreStart
// $HTTP_RAW_POST_DATA is deprecated on PHP 5.6.
if ( function_exists( 'phpversion' ) && version_compare( phpversion(), '5.6', '>=' ) ) {
return file_get_contents( 'php://input' );
}
@ -633,6 +634,7 @@ class WC_API_Server {
}
return $HTTP_RAW_POST_DATA;
// @codingStandardsIgnoreEnd
}
/**

View File

@ -651,7 +651,8 @@ class WC_API_Server {
* @return string
*/
public function get_raw_data() {
// $HTTP_RAW_POST_DATA is deprecated on PHP 5.6
// @codingStandardsIgnoreStart
// $HTTP_RAW_POST_DATA is deprecated on PHP 5.6.
if ( function_exists( 'phpversion' ) && version_compare( phpversion(), '5.6', '>=' ) ) {
return file_get_contents( 'php://input' );
}
@ -665,6 +666,7 @@ class WC_API_Server {
}
return $HTTP_RAW_POST_DATA;
// @codingStandardsIgnoreEnd
}
/**

View File

@ -658,7 +658,8 @@ class WC_API_Server {
* @return string
*/
public function get_raw_data() {
// $HTTP_RAW_POST_DATA is deprecated on PHP 5.6
// @codingStandardsIgnoreStart
// $HTTP_RAW_POST_DATA is deprecated on PHP 5.6.
if ( function_exists( 'phpversion' ) && version_compare( phpversion(), '5.6', '>=' ) ) {
return file_get_contents( 'php://input' );
}
@ -672,6 +673,7 @@ class WC_API_Server {
}
return $HTTP_RAW_POST_DATA;
// @codingStandardsIgnoreEnd
}
/**

View File

@ -324,7 +324,7 @@ class WC_Download_Handler {
private static function check_server_config() {
wc_set_time_limit( 0 );
if ( function_exists( 'get_magic_quotes_runtime' ) && get_magic_quotes_runtime() && version_compare( phpversion(), '5.4', '<' ) ) {
set_magic_quotes_runtime( 0 );
set_magic_quotes_runtime( 0 ); // @codingStandardsIgnoreLine
}
if ( function_exists( 'apache_setenv' ) ) {
@apache_setenv( 'no-gzip', 1 );