commit 6ffcc8ad3b80ba76e5b2b317ba07ca0bf968db39
parent 3fe70c58d4bd9035cc766f6aaecb65a2c0779267
Author: markseu <mark2011@mayberg.se>
Date: Wed, 13 Dec 2017 13:51:28 +0100
Better error message
Diffstat:
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/system/plugins/core.php b/system/plugins/core.php
@@ -641,7 +641,11 @@ class YellowPage
{
$this->error(500, "Folder '".dirname($this->fileName)."' may not contain subfolders!");
}
- if($this->yellow->toolbox->isRequestSelf()) $this->error(500, "Rewrite module not enabled on this server!");
+ if($this->yellow->toolbox->isRequestSelf())
+ {
+ $serverVersion = $this->yellow->toolbox->getServerVersion(true);
+ $this->error(500, "Rewrite module not working on $serverVersion web server!");
+ }
if($this->yellow->getRequestHandler()=="core" && $this->isExisting("redirect") && $this->statusCode==200)
{
$location = $this->yellow->lookup->normaliseLocation($this->get("redirect"), $this->location);
@@ -2635,10 +2639,11 @@ class YellowLookup
class YellowToolbox
{
// Return server version from current HTTP request
- function getServerVersion()
+ function getServerVersion($shortFormat = false)
{
$serverVersion = strtoupperu(PHP_SAPI)." ".PHP_OS;
if(preg_match("/^(\S+)/", $_SERVER["SERVER_SOFTWARE"], $matches)) $serverVersion = $matches[1]." ".PHP_OS;
+ if($shortFormat && preg_match("/^(\pL+)/u", $serverVersion, $matches)) $serverVersion = $matches[1];
return $serverVersion;
}
diff --git a/system/plugins/update.php b/system/plugins/update.php
@@ -598,8 +598,9 @@ class YellowUpdate
$status = trim($_REQUEST["status"]);
if($status=="install")
{
+ $serverVersion = $this->yellow->toolbox->getServerVersion(true);
$status = $this->checkServerRewrite($scheme, $address, $base, $location, $fileName) ? "ok" : "error";
- if($status=="error") $this->yellow->page->error(500, "Rewrite module not working on this server!");
+ if($status=="error") $this->yellow->page->error(500, "Rewrite module not working on $serverVersion web server!");
}
if($status=="ok")
{