| @@ -71,9 +71,8 @@ | ||
| 71 | 71 | $string = strtolower( $string ); |
| 72 | 72 | |
| 73 | 73 | foreach( $patterns as $pattern ) { |
| 74 | 74 | |
| 75 | - $pattern = rtrim( $pattern, '/' ); | |
| 76 | 75 | $pattern = strtolower( $pattern ); |
| 77 | 76 | |
| 78 | 77 | if( function_exists( 'fnmatch' ) ) { |
| 79 | 78 | $match = fnmatch( $pattern, $string ); |
| @@ -88,24 +87,8 @@ | ||
| 88 | 87 | |
| 89 | 88 | return false; |
| 90 | 89 | } |
| 91 | 90 | |
| 92 | - /** | |
| 93 | - * @return string | |
| 94 | - */ | |
| 95 | - protected function get_request_url() { | |
| 96 | - // strip trailing slashes | |
| 97 | - $request_uri = rtrim( $_SERVER['REQUEST_URI'], '/' ); | |
| 98 | - | |
| 99 | - // strip ? and query string | |
| 100 | - $qpos = strpos( $request_uri, '?' ); | |
| 101 | - if( $qpos ) { | |
| 102 | - $request_uri = substr( $request_uri, 0, $qpos ); | |
| 103 | - } | |
| 104 | - | |
| 105 | - return $request_uri; | |
| 106 | - } | |
| 107 | - | |
| 108 | 91 | /** |
| 109 | 92 | * Check if this rule passes (conditional matches expected value) |
| 110 | 93 | * |
| 111 | 94 | * @param string $condition |
| @@ -126,9 +109,9 @@ | ||
| 126 | 109 | $matched = true; |
| 127 | 110 | break; |
| 128 | 111 | |
| 129 | 112 | case 'is_url': |
| 130 | - $matched = $this->match_patterns( $this->get_request_url(), $value ); | |
| 113 | + $matched = $this->match_patterns( $_SERVER['REQUEST_URI'], $value ); | |
| 131 | 114 | break; |
| 132 | 115 | |
| 133 | 116 | case 'is_referer': |
| 134 | 117 | if( ! empty( $_SERVER['HTTP_REFERER'] ) ) { |