phpcompat icon indicating copy to clipboard operation
phpcompat copied to clipboard

False positive: WP OAuth Server

Open greguly opened this issue 6 years ago • 0 comments

This is the report:

FILE: /nas/content/live/xxx/wp-content/plugins/oauth2-provider/library/OAuth2/Request.php
------------------------------------------------------------------------------------------------------------------------------------
FOUND 4 ERRORS AFFECTING 4 LINES
------------------------------------------------------------------------------------------------------------------------------------
 101 | ERROR | Global variable '$HTTP_RAW_POST_DATA' is deprecated since PHP 5.6 and removed since PHP 7.0; Use php://input instead
 104 | ERROR | Global variable '$HTTP_RAW_POST_DATA' is deprecated since PHP 5.6 and removed since PHP 7.0; Use php://input instead
 109 | ERROR | Global variable '$HTTP_RAW_POST_DATA' is deprecated since PHP 5.6 and removed since PHP 7.0; Use php://input instead
 112 | ERROR | Global variable '$HTTP_RAW_POST_DATA' is deprecated since PHP 5.6 and removed since PHP 7.0; Use php://input instead
------------------------------------------------------------------------------------------------------------------------------------

and this is the code:

		if ( true === $asResource ) {
			$this->content = false;

101:			if ( ! isset( $HTTP_RAW_POST_DATA ) ) {
				return fopen( 'php://input', 'rb' );
			} else {
104:				return $HTTP_RAW_POST_DATA;
			}
		}

		if ( null === $this->content ) {
109:			if ( ! isset( $HTTP_RAW_POST_DATA ) ) {
				$this->content = file_get_contents( 'php://input' );
			} else {
112:				$this->content = $HTTP_RAW_POST_DATA;
			}
		}

greguly avatar May 09 '18 19:05 greguly