diff options
| author | Lester Caine <lester@lsces.co.uk> | 2026-06-01 12:33:30 +0100 |
|---|---|---|
| committer | Lester Caine <lester@lsces.co.uk> | 2026-06-01 12:33:30 +0100 |
| commit | 9581a97aa4b9d8df3b28c25572592605c6615d3f (patch) | |
| tree | 72898a3210565639e8ec68db3a84496deb6fe12a /index.php | |
| parent | 8c2daabe542146569949cfd3c0971bacf79b4501 (diff) | |
| download | bitweaver-9581a97aa4b9d8df3b28c25572592605c6615d3f.tar.gz bitweaver-9581a97aa4b9d8df3b28c25572592605c6615d3f.tar.bz2 bitweaver-9581a97aa4b9d8df3b28c25572592605c6615d3f.zip | |
Guard getDisplayUrl() result before preg_match and bit_redirect in content_id dispatch
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'index.php')
| -rwxr-xr-x | index.php | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -23,7 +23,7 @@ if( !$gBitSystem->isDatabaseValid() ) { if( !empty( $_REQUEST['content_id'] )) { if( $obj = LibertyBase::getLibertyObject( $_REQUEST['content_id'] )) { $url = $obj->getDisplayUrl(); - if( !empty($_REQUEST['highlight'] )) { + if( !empty($_REQUEST['highlight']) && !empty($url) ) { if( preg_match( '/\?/', $url )) { $url .= '&'; } else { @@ -31,7 +31,9 @@ if( !empty( $_REQUEST['content_id'] )) { } $url .= 'highlight='.$_REQUEST['highlight']; } - KernelTools::bit_redirect( $url ); + if( !empty($url) ) { + KernelTools::bit_redirect( $url ); + } } } elseif( !empty( $_REQUEST['structure_id'] )) { include LIBERTY_PKG_PATH.'display_structure_inc.php'; |
