diff --git a/lib/internal/Magento/Framework/Webapi/Rest/Request/Deserializer/Xml.php b/lib/internal/Magento/Framework/Webapi/Rest/Request/Deserializer/Xml.php index bf72d8b04ff16..53f36cf08b3a3 100644 --- a/lib/internal/Magento/Framework/Webapi/Rest/Request/Deserializer/Xml.php +++ b/lib/internal/Magento/Framework/Webapi/Rest/Request/Deserializer/Xml.php @@ -1,7 +1,7 @@ parserFactory->create(); $xmlParser->loadXML($xmlRequestBody); - restore_error_handler(); - if (isset($previousLoaderState)) { - libxml_disable_entity_loader($previousLoaderState); - } /** Process errors during XML parsing. */ if ($this->_errorMessage !== null) { diff --git a/lib/internal/Magento/Framework/Xml/Security.php b/lib/internal/Magento/Framework/Xml/Security.php index 8d125736c6d3e..8934a7c126c86 100644 --- a/lib/internal/Magento/Framework/Xml/Security.php +++ b/lib/internal/Magento/Framework/Xml/Security.php @@ -1,7 +1,7 @@ checkXDebugNestedLevel(), - $this->checkPopulateRawPostSetting(), $this->checkFunctionsExistence() ); @@ -270,52 +269,6 @@ private function checkXDebugNestedLevel() return $data; } - /** - * Checks if PHP version >= 5.6.0 and always_populate_raw_post_data is set to -1 - * - * Beginning PHP 7.0, support for 'always_populate_raw_post_data' is going to removed. - * And beginning PHP 5.6, a deprecated message is displayed if 'always_populate_raw_post_data' - * is set to a value other than -1. - * - * @return array - */ - private function checkPopulateRawPostSetting() - { - // HHVM and PHP 7does not support 'always_populate_raw_post_data' to be set to -1 - if (version_compare(PHP_VERSION, '7.0.0-beta') >= 0 || defined('HHVM_VERSION')) { - return []; - } - - $data = []; - $error = false; - $iniSetting = (int)ini_get('always_populate_raw_post_data'); - - $checkVersionConstraint = $this->versionParser->parseConstraints('~5.6.0'); - $normalizedPhpVersion = $this->getNormalizedCurrentPhpVersion(PHP_VERSION); - $currentVersion = $this->versionParser->parseConstraints($normalizedPhpVersion); - if ($checkVersionConstraint->matches($currentVersion) && $iniSetting !== -1) { - $error = true; - } - - $message = sprintf( - 'Your PHP Version is %s, but always_populate_raw_post_data = %d. - $HTTP_RAW_POST_DATA is deprecated from PHP 5.6 onwards and will be removed in PHP 7.0. - This will stop the installer from running. - Please open your php.ini file and set always_populate_raw_post_data to -1. - If you need more help please call your hosting provider.', - PHP_VERSION, - (int)ini_get('always_populate_raw_post_data') - ); - - $data['always_populate_raw_post_data'] = [ - 'message' => $message, - 'helpUrl' => 'http://php.net/manual/en/ini.core.php#ini.always-populate-settings-data', - 'error' => $error - ]; - - return $data; - } - /** * Check whether all special functions exists * diff --git a/setup/src/Magento/Setup/Test/Unit/Model/PhpReadinessCheckTest.php b/setup/src/Magento/Setup/Test/Unit/Model/PhpReadinessCheckTest.php index 919b16c20140e..088a420256907 100644 --- a/setup/src/Magento/Setup/Test/Unit/Model/PhpReadinessCheckTest.php +++ b/setup/src/Magento/Setup/Test/Unit/Model/PhpReadinessCheckTest.php @@ -1,7 +1,7 @@ ResponseTypeInterface::RESPONSE_TYPE_SUCCESS, 'data' => [ @@ -267,14 +259,6 @@ public function testCheckPhpSettings(): void ] ] ]; - if (!$this->isPhp7OrHhvm()) { - $this->setUpNoPrettyVersionParser(); - $expected['data']['always_populate_raw_post_data'] = [ - 'message' => $rawPostMessage, - 'helpUrl' => 'http://php.net/manual/en/ini.core.php#ini.always-populate-settings-data', - 'error' => false - ]; - } $this->assertEquals($expected, $this->phpReadinessCheck->checkPhpSettings()); } @@ -293,14 +277,6 @@ public function testCheckPhpSettingsFailed(): void 200 ); - $rawPostMessage = sprintf( - 'Your PHP Version is %s, but always_populate_raw_post_data = -1. - $HTTP_RAW_POST_DATA is deprecated from PHP 5.6 onwards and will be removed in PHP 7.0. - This will stop the installer from running. - Please open your php.ini file and set always_populate_raw_post_data to -1. - If you need more help please call your hosting provider.', - PHP_VERSION - ); $expected = [ 'responseType' => ResponseTypeInterface::RESPONSE_TYPE_ERROR, 'data' => [ @@ -315,14 +291,6 @@ public function testCheckPhpSettingsFailed(): void ] ] ]; - if (!$this->isPhp7OrHhvm()) { - $this->setUpNoPrettyVersionParser(); - $expected['data']['always_populate_raw_post_data'] = [ - 'message' => $rawPostMessage, - 'helpUrl' => 'http://php.net/manual/en/ini.core.php#ini.always-populate-settings-data', - 'error' => false - ]; - } $this->assertEquals($expected, $this->phpReadinessCheck->checkPhpSettings()); } @@ -333,28 +301,10 @@ public function testCheckPhpSettingsNoXDebug(): void { $this->phpInfo->expects($this->once())->method('getCurrent')->willReturn([]); - $rawPostMessage = sprintf( - 'Your PHP Version is %s, but always_populate_raw_post_data = -1. - $HTTP_RAW_POST_DATA is deprecated from PHP 5.6 onwards and will be removed in PHP 7.0. - This will stop the installer from running. - Please open your php.ini file and set always_populate_raw_post_data to -1. - If you need more help please call your hosting provider.', - PHP_VERSION - ); $expected = [ 'responseType' => ResponseTypeInterface::RESPONSE_TYPE_SUCCESS, 'data' => [] ]; - if (!$this->isPhp7OrHhvm()) { - $this->setUpNoPrettyVersionParser(); - $expected['data'] = [ - 'always_populate_raw_post_data' => [ - 'message' => $rawPostMessage, - 'helpUrl' => 'http://php.net/manual/en/ini.core.php#ini.always-populate-settings-data', - 'error' => false - ] - ]; - } $expected['data']['missed_function_imagecreatefromjpeg'] = [ 'message' => 'You must have installed GD library with --with-jpeg-dir=DIR option.', @@ -453,14 +403,6 @@ public function testCheckPhpExtensionsFailed(): void ]; $this->assertEquals($expected, $this->phpReadinessCheck->checkPhpExtensions()); } - - /** - * @return bool - */ - protected function isPhp7OrHhvm(): bool - { - return version_compare(PHP_VERSION, '7.0.0-beta') >= 0 || defined('HHVM_VERSION'); - } } namespace Magento\Setup\Model; @@ -473,8 +415,6 @@ function ini_get($param) { if ($param === 'xdebug.max_nesting_level') { return 100; - } elseif ($param === 'always_populate_raw_post_data') { - return -1; } elseif ($param === 'memory_limit') { return '512M'; }