diff --git a/.htaccess b/.htaccess index af7e961379c1209dbb3d828f2fe19f6307edcf72..962e969d59c8c9eb8d69f8cc4a6e8007ff5d4285 100644 --- a/.htaccess +++ b/.htaccess @@ -12,6 +12,7 @@ php_value upload_max_filesize 513M php_value post_max_size 513M php_value memory_limit 512M php_value mbstring.func_overload 0 +php_value always_populate_raw_post_data -1 <IfModule env_module> SetEnv htaccessWorking true </IfModule> diff --git a/.user.ini b/.user.ini index 9f3691e5fbaf9f319f9defc047580d293896de53..09f6a05ff6cf1162544f69044662eabe987b078d 100644 --- a/.user.ini +++ b/.user.ini @@ -2,3 +2,4 @@ upload_max_filesize=513M post_max_size=513M memory_limit=512M mbstring.func_overload=0 +always_populate_raw_post_data=-1 diff --git a/lib/private/util.php b/lib/private/util.php index e2b7eed1ba5c9049c1d53c75d3eb4e1af8b75061..35b86da5d5370ff8bb0c777b6bd880f9604d337a 100644 --- a/lib/private/util.php +++ b/lib/private/util.php @@ -628,10 +628,25 @@ class OC_Util { ); $webServerRestart = true; } + + /** + * PHP 5.6 ships with a PHP setting which throws notices by default for a + * lot of endpoints. Thus we need to ensure that the value is set to -1 + * + * @link https://github.com/owncloud/core/issues/13592 + */ + if(version_compare(phpversion(), '5.6.0', '>=') && + \OC::$server->getIniWrapper()->getNumeric('always_populate_raw_post_data') !== -1) { + $errors[] = array( + 'error' => $l->t('PHP is configured to populate raw post data. Since PHP 5.6 this will lead to PHP throwing notices for perfectly valid code.'), + 'hint' => $l->t('To fix this issue set <code>always_populate_raw_post_data</code> to <code>-1</code> in your php.ini') + ); + } + if (!self::isAnnotationsWorking()) { $errors[] = array( - 'error' => 'PHP is apparently setup to strip inline doc blocks. This will make several core apps inaccessible.', - 'hint' => 'This is probably caused by a cache/accelerator such as Zend OPcache or eAccelerator.' + 'error' => $l->t('PHP is apparently setup to strip inline doc blocks. This will make several core apps inaccessible.'), + 'hint' => $l->t('This is probably caused by a cache/accelerator such as Zend OPcache or eAccelerator.') ); }