Archives
Trending
Support
Login
clear text
XML
Django
JavaScript
MATLAB
C
C++
C#
Python
SQL
Shell
Bash
Markdown
YAML
JSON
HTML
CSS
PHP
Java
Ruby
Go
Rust
Swift
Kotlin
Arduino
TypeScript
Perl
Autohotkey
Lua
SQF
R
Scala
Haskell
Groovy
Dart
Clojure
VB.NET
Objective-C
PowerShell
Bash
CoffeeScript
Verilog
--- includes/common-functions.php (revision 3522779) +++ includes/common-functions.php (working copy) @@ -105,11 +105,14 @@ /** * Do two URLs point at the same location on a web site? * - * Preps URL, if string + * Preps URL, if string. Argument order matters: when the expected URL ($url1) + * has no query parameters, any query parameters on the actual URL ($url2) + * are ignored. When the expected URL specifies query parameters, strict + * equality applies. * - * @param string/array $url1 URL to compare, a string, or an array in special format created by companion function - * @param string/array $url2 URL to compare, a string, or an array in special format created by companion function - * @return bool bool TRUE if URL matches prefix; FALSE otherwise + * @param string/array $url1 Expected URL (e.g. allowlist entry), a string, or an array in special format created by companion function + * @param string/array $url2 Actual URL (e.g. visitor request), a string, or an array in special format created by companion function + * @return bool bool TRUE if URL matches; FALSE otherwise */ if ( ! function_exists( 'jr_v1_same_url' ) ) { function jr_v1_same_url( $url1, $url2 ) { @@ -119,6 +122,9 @@ if ( is_string( $url2 ) ) { $url2 = jr_v1_prep_url( $url2 ); } + if ( array() === $url1['query'] ) { + $url2['query'] = array(); + } return ( $url1 == $url2 ); } }
Mark as private (unlisted)
for 30 minutes
for 6 hours
for 1 day
for 1 week
for 1 month
for 1 year
everlasting (like CCCP)