aboutsummaryrefslogtreecommitdiffstats
path: root/index.cgi
diff options
context:
space:
mode:
authorNaglfar <rpblc.net>2023-06-07 15:53:57 +0000
committerNaglfar <rpblc.net>2023-06-07 15:53:57 +0000
commitbfc5f8d1bf84865c1fe795831005b16b95ce433c (patch)
treeec1bab37d5e891aaf3aa34389d4807041d6d5fd4 /index.cgi
parent90688a29a522c21f06d9c70db8f675693f9ea668 (diff)
check if environment variable REQUEST_URI is defined
Diffstat (limited to 'index.cgi')
-rwxr-xr-xindex.cgi15
1 files changed, 8 insertions, 7 deletions
diff --git a/index.cgi b/index.cgi
index 91778f1..2f12203 100755
--- a/index.cgi
+++ b/index.cgi
@@ -1,14 +1,15 @@
#!/usr/bin/perl -wT
+$request = 'main';
# breaks up a string according to a separator
-@uri = split('/', $ENV{REQUEST_URI});
-if ( $#uri > -1 && -e "/openwcms/data/$uri[1].html" )
+if(defined($ENV{REQUEST_URI}))
{
- $request = "$uri[1]";
-}
-else
-{
- $request = 'main';
+ @uri = split('/', $ENV{REQUEST_URI});
+
+ if( $#uri > -1 && -e "/openwcms/data/$uri[1].html" )
+ {
+ $request = "$uri[1]";
+ }
}
require '/openwcms/add_items.pl';