summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorLukas Reschke <lukas@owncloud.com>2015-01-22 13:46:40 +0100
committerLukas Reschke <lukas@owncloud.com>2015-01-22 13:50:38 +0100
commitbb80cf4ecab3a92541bf9c2fccaa204b6ea914f9 (patch)
treefb94e03746713a0b98eb1711435e0edad3c88c20 /lib
parentb5b491d1bb12a869ddae7878e8aa441109419a00 (diff)
downloadnextcloud-server-bb80cf4ecab3a92541bf9c2fccaa204b6ea914f9.tar.gz
nextcloud-server-bb80cf4ecab3a92541bf9c2fccaa204b6ea914f9.zip
Add check for `HTTP_RAW_POST_DATA` setting for >= 5.6
PHP 5.6 otherwise throws notices for perfectly valid code which results in broken endpoints. Fixes https://github.com/owncloud/core/issues/13592
Diffstat (limited to 'lib')
-rw-r--r--lib/private/util.php15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/private/util.php b/lib/private/util.php
index 3b943f046bf..a4d3b558ce0 100644
--- a/lib/private/util.php
+++ b/lib/private/util.php
@@ -628,6 +628,21 @@ 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' => 'PHP is configured to populate raw post data. Since PHP 5.6 this will lead to PHP throwing notices for perfectly valid code.',
+ 'hint' => '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.',