Ignore:
Timestamp:
May 26, 2019 1:59:55 AM (5 years ago)
Author:
anonymous
Message:

Add getHiddenSession() method. Use strstr() instead of strtok() for getting queryless URI.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/Navigation.inc.php

    r682 r686  
    440440        }
    441441
    442         $actual_uri = $include_query ? $_SERVER['REQUEST_URI'] : strtok($_SERVER['REQUEST_URI'], '?');
    443         $test_uri = $include_query ? $test_uri : strtok($test_uri, '?');
     442        $actual_uri = $include_query ? $_SERVER['REQUEST_URI'] : (strstr(getenv('REQUEST_URI'), '?', true) ?: getenv('REQUEST_URI')); // strstr() returns false if '?' is not found, so use a shorthand ternary operator.
     443        $test_uri = $include_query ? $test_uri : (strstr($test_uri, '?', true) ?: $test_uri); // strstr() returns false if '?' is not found, so use a shorthand ternary operator.
    444444        if (mb_strtolower($test_uri) == mb_strtolower($actual_uri)) {
    445445            // $app->logMsg(sprintf('Current page (%s) == test URI (%s)', $actual_uri, $test_uri), LOG_DEBUG, __FILE__, __LINE__);
Note: See TracChangeset for help on using the changeset viewer.