Skip to content

Commit

Permalink
Escape the string passed into regex
Browse files Browse the repository at this point in the history
  • Loading branch information
mantis committed Nov 18, 2008
1 parent 1968eb5 commit da50c6e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion config_defaults_inc.php
Expand Up @@ -115,7 +115,7 @@
$t_file_path = str_replace( DIRECTORY_SEPARATOR, '/', __FILE__ );

# Extract the unique directory path of this file relative to the server's documunt root
if ( preg_match( '@'.$t_docroot.'(.*)@', $t_file_path, $t_matches ) ) {
if ( preg_match( '@' . preg_quote( $t_docroot ) . '(.*)@', $t_file_path, $t_matches ) ) {
$t_path = dirname( strip_tags( $t_matches[1] ) );
} else {
$t_path = dirname( strip_tags( $_SERVER['PHP_SELF'] ) );
Expand Down

0 comments on commit da50c6e

Please sign in to comment.