Non-existing .php files in request path cause redirect to main page
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Quam Plures |
Fix Released
|
Medium
|
Tilman Blumenbach |
Bug Description
When requesting a non-existing page through an URL like "http://
If one changes the last part of the URL to end with .php (e. g. http://
This buggy behaviour is caused by the following redundant check in inc/_blog_
> if( isset( $path_elements[0] ) && preg_match( '#.*\.php[0-9]?$#', $path_elements[0] ) )
> { // Ignore element ending with .php (fp: note: may be just '.php')
> array_shift( $path_elements );
> $Debuglog->add( 'Ignoring *.php in extra path info' , 'params' );
> }
Why is this check redundant? A base file name like index.php gets removed in line 124:
> if( preg_match( $blog_baseuri_
...and a possible stub file gets array_shift()'d later, in lines 149-155:
> if( isset( $path_elements[0] )
> && ( $path_elements[0] == $Blog->stub
> || $path_elements[0] == $Blog->urlname ) )
> { // Ignore stub file (if it ends with .php it should already have been filtered out above)
> array_shift( $path_elements );
> $Debuglog->add( 'Ignoring stub filename OR blog urlname in extra path info' , 'params' );
> }
The fix for this bug obviously is to remove the redundant check.
Related branches
- EdB: Approve
-
Diff: 16 lines (+0/-6)1 file modifiedinc/_blog_main.inc.php (+0/-6)
Changed in quam-plures: | |
status: | In Progress → Fix Committed |
Changed in quam-plures: | |
status: | Fix Committed → Fix Released |