Skip to content

Commit

Permalink
[stable12] Also make sure remote.php and public.php don't work on 7.2
Browse files Browse the repository at this point in the history
Fixes #7415

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
  • Loading branch information
rullzer committed Feb 6, 2018
1 parent 3df8021 commit dfe6a93
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
19 changes: 19 additions & 0 deletions public.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,25 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*/


// Show warning if a PHP version below 5.6.0 is used, this has to happen here
// because base.php will already use 5.6 syntax.
if (version_compare(PHP_VERSION, '5.6.0') === -1) {
echo 'This version of Nextcloud requires at least PHP 5.6.0<br/>';
echo 'You are currently running ' . PHP_VERSION . '. Please update your PHP version.';
return;
}

// Show warning if PHP 7.2 is used as Nextcloud is not compatible with PHP 7.2 for now
// @see https://github.com/nextcloud/server/pull/5791
if (version_compare(PHP_VERSION, '7.2.0') !== -1) {
echo 'This version of Nextcloud is not compatible with PHP 7.2.<br/>';
echo 'You are currently running ' . PHP_VERSION . '.';
return;
}


try {

require_once __DIR__ . '/lib/base.php';
Expand Down
17 changes: 17 additions & 0 deletions remote.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,23 @@
use Sabre\DAV\Exception\ServiceUnavailable;
use Sabre\DAV\Server;

// Show warning if a PHP version below 5.6.0 is used, this has to happen here
// because base.php will already use 5.6 syntax.
if (version_compare(PHP_VERSION, '5.6.0') === -1) {
echo 'This version of Nextcloud requires at least PHP 5.6.0<br/>';
echo 'You are currently running ' . PHP_VERSION . '. Please update your PHP version.';
return;
}

// Show warning if PHP 7.2 is used as Nextcloud is not compatible with PHP 7.2 for now
// @see https://github.com/nextcloud/server/pull/5791
if (version_compare(PHP_VERSION, '7.2.0') !== -1) {
echo 'This version of Nextcloud is not compatible with PHP 7.2.<br/>';
echo 'You are currently running ' . PHP_VERSION . '.';
return;
}


/**
* Class RemoteException
* Dummy exception class to be use locally to identify certain conditions
Expand Down

0 comments on commit dfe6a93

Please sign in to comment.