Skip to content

Commit

Permalink
fix: replacing url's with query strings without the query in the modi…
Browse files Browse the repository at this point in the history
…fied url #141
  • Loading branch information
GrigoreMihai committed Sep 18, 2019
1 parent ba75f31 commit 0025559
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion inc/manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,11 @@ function ( $url ) {
);

foreach ( $urls as $origin => $replace ) {
$origin = strtok( $origin, '?' );
if ( strstr( $origin, '?' ) !== false ) {
$origin = explode( '?', $origin );
$origin[1] = htmlentities( $origin[1] );
$origin = join( '?', $origin );
}
$html = preg_replace( '/(?<!\/)' . preg_quote( $origin, '/' ) . '/m', $replace, $html );
}

Expand Down

1 comment on commit 0025559

@GrigoreMihai
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@preda-bogdan it works now

Please sign in to comment.