diff options
author | Naglfar <rpblc.net> | 2023-06-07 15:53:57 +0000 |
---|---|---|
committer | Naglfar <rpblc.net> | 2023-06-07 15:53:57 +0000 |
commit | bfc5f8d1bf84865c1fe795831005b16b95ce433c (patch) | |
tree | ec1bab37d5e891aaf3aa34389d4807041d6d5fd4 | |
parent | 90688a29a522c21f06d9c70db8f675693f9ea668 (diff) |
check if environment variable REQUEST_URI is defined
-rwxr-xr-x | index.cgi | 15 |
1 files changed, 8 insertions, 7 deletions
@@ -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'; |