aboutsummaryrefslogtreecommitdiff
path: root/lib/Minz
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2018-12-22 13:22:20 +0100
committerGravatar GitHub <noreply@github.com> 2018-12-22 13:22:20 +0100
commitf0a359619fa2936d66a2b96dd086d4686e7405fa (patch)
treeddad42a7f6813bd458f39d5203d083daad4cc1c5 /lib/Minz
parente04804d0f67dd43fd3f072b9a127768ee7b7b56c (diff)
parent4a1a852f457d52fa47191e3f7e3e9073e1324cd9 (diff)
Merge pull request #2186 from FreshRSS/dev1.13.0
FreshRSS 1.13.0
Diffstat (limited to 'lib/Minz')
-rw-r--r--lib/Minz/ActionException.php4
-rw-r--r--lib/Minz/ControllerNotExistException.php4
-rw-r--r--lib/Minz/Request.php7
3 files changed, 8 insertions, 7 deletions
diff --git a/lib/Minz/ActionException.php b/lib/Minz/ActionException.php
index f1f70c1bc..311f15086 100644
--- a/lib/Minz/ActionException.php
+++ b/lib/Minz/ActionException.php
@@ -1,9 +1,7 @@
<?php
class Minz_ActionException extends Minz_Exception {
public function __construct ($controller_name, $action_name, $code = self::ERROR) {
- $message = '`' . $action_name . '` cannot be invoked on `'
- . $controller_name . '`';
-
+ $message = 'Invalid action name for controller ' . $controller_name;
parent::__construct ($message, $code);
}
}
diff --git a/lib/Minz/ControllerNotExistException.php b/lib/Minz/ControllerNotExistException.php
index 24a09a635..dcdaa94d1 100644
--- a/lib/Minz/ControllerNotExistException.php
+++ b/lib/Minz/ControllerNotExistException.php
@@ -1,9 +1,7 @@
<?php
class Minz_ControllerNotExistException extends Minz_Exception {
public function __construct ($controller_name, $code = self::ERROR) {
- $message = 'Controller `' . $controller_name
- . '` doesn\'t exist';
-
+ $message = 'Controller not found!';
parent::__construct ($message, $code);
}
}
diff --git a/lib/Minz/Request.php b/lib/Minz/Request.php
index 24e30546f..8b2b610d6 100644
--- a/lib/Minz/Request.php
+++ b/lib/Minz/Request.php
@@ -118,7 +118,9 @@ class Minz_Request {
$https = self::isHttps();
- if (!empty($_SERVER['HTTP_HOST'])) {
+ if (!empty($_SERVER['HTTP_X_FORWARDED_HOST'])) {
+ $host = parse_url('http://' . $_SERVER['HTTP_X_FORWARDED_HOST'], PHP_URL_HOST);
+ } elseif (!empty($_SERVER['HTTP_HOST'])) {
//Might contain a port number, and mind IPv6 addresses
$host = parse_url('http://' . $_SERVER['HTTP_HOST'], PHP_URL_HOST);
} elseif (!empty($_SERVER['SERVER_NAME'])) {
@@ -142,6 +144,9 @@ class Minz_Request {
} else {
$url .= '://' . $host . ($port == 80 ? '' : ':' . $port);
}
+ if (!empty($_SERVER['HTTP_X_FORWARDED_PREFIX'])) {
+ $url .= rtrim($_SERVER['HTTP_X_FORWARDED_PREFIX'], '/ ');
+ }
if (isset($_SERVER['REQUEST_URI'])) {
$path = $_SERVER['REQUEST_URI'];
$url .= substr($path, -1) === '/' ? substr($path, 0, -1) : dirname($path);