summaryrefslogtreecommitdiffstats
path: root/application/controllers/Main.php
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2017-09-21 11:16:07 +0200
committerFlorian Pritz <bluewind@xinu.at>2017-09-21 11:16:07 +0200
commit4a8d9de07e65b93a2329e9f7176b3148f7d7bcef (patch)
tree5d116b28771a1f242fc6b4348eb0061c596e3930 /application/controllers/Main.php
parent1ee7c987f2a0da0678ca5c8c55af7d6138d34872 (diff)
Fix detection of URL ending in slash
CI trims tailing slashes from the URL and this should work just fine too. Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'application/controllers/Main.php')
-rw-r--r--application/controllers/Main.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/application/controllers/Main.php b/application/controllers/Main.php
index e7775d6d2..279d34520 100644
--- a/application/controllers/Main.php
+++ b/application/controllers/Main.php
@@ -171,7 +171,7 @@ class Main extends MY_Controller {
// autodetect the lexer for highlighting if the URL contains a / after the ID (/ID/)
// /ID/lexer disables autodetection
- $autodetect_lexer = !$lexer && substr_count(ltrim($this->uri->uri_string(), "/"), '/') >= 1;
+ $autodetect_lexer = !$lexer && preg_match('/^[^?]*\/(\?.*)?$/', $_SERVER['REQUEST_URI']);
$autodetect_lexer = $is_multipaste ? true : $autodetect_lexer;
if ($autodetect_lexer) {
$lexer = $pygments->autodetect_lexer();