Skip to content

Commit

Permalink
We can’t trim trailing slashes for ruls with query params
Browse files Browse the repository at this point in the history
  • Loading branch information
kasparsd committed Jun 13, 2018
1 parent 142df6f commit e349008
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions class/class-widget-context.php
Original file line number Diff line number Diff line change
Expand Up @@ -464,8 +464,8 @@ function match_path( $path, $patterns ) {
$rows = explode( "\n", $patterns );

foreach ( $rows as $pattern ) {
// Trim trailing, leading slashes and whitespace
$pattern = trim( trim( $pattern ), '/' );
// Trim leading slashes and whitespace.
$pattern = ltrim( trim( $pattern ), '/' );

// Escape regex chars since we only support wildcards.
$pattern = preg_quote( $pattern, '/' );
Expand Down

0 comments on commit e349008

Please sign in to comment.