Fix this by also checking for an empty PATH_INFO before using it.
Signed-off-by: Uli Schlachter <psy...@znc.in>
---
lib/qbURL.php | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/lib/qbURL.php b/lib/qbURL.php
index 6f3e96f..3167af8 100644
--- a/lib/qbURL.php
+++ b/lib/qbURL.php
@@ -154,7 +154,7 @@ class qbURL {
public static function getVFile() {
$path = QB_URIPATH;
// PATH_INFO is set for Apache's "Alias" directive, it has precedence.
- if (isset($_SERVER['PATH_INFO']))
+ if (isset($_SERVER['PATH_INFO']) && $_SERVER['PATH_INFO'] != '')
$path = $_SERVER['PATH_INFO'];
else if (qbString::startsWith(self::getHandler(), $path))
$path = substr($path, strlen(self::getHandler()));
--
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
G d- s:- a--- C+++>$ UL++>$ P L++>$ !E W++ !N o? K? w-- !O !M V? PS+ PE Y+
PGP++>+++ !t 5? !X !R-* tv+>- b+ DI->+ !D G e h+ r? y
------END GEEK CODE BLOCK------
Thanks, applied as 08989d87ca3f194a72ac4d16a52dfffa2a5be5b6.
I'm not 100% sure whether this can cause problems, for example if
PATH_INFO contains an empty string _on purpose_. But since qb should
work without PATH_INFO being set at all, I doubt that there will be
problems. Added a TODO item nevertheless.
By the way, http://www.invir.com/int-prog-cgivar.html looks nice.
Regards,
Tim.