summaryrefslogtreecommitdiff
path: root/index.php
diff options
context:
space:
mode:
authorLester Caine <lester@lsces.co.uk>2026-06-01 12:33:30 +0100
committerLester Caine <lester@lsces.co.uk>2026-06-01 12:33:30 +0100
commit9581a97aa4b9d8df3b28c25572592605c6615d3f (patch)
tree72898a3210565639e8ec68db3a84496deb6fe12a /index.php
parent8c2daabe542146569949cfd3c0971bacf79b4501 (diff)
downloadbitweaver-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-xindex.php6
1 files changed, 4 insertions, 2 deletions
diff --git a/index.php b/index.php
index 2004954..7d15842 100755
--- a/index.php
+++ b/index.php
@@ -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';