- // some versions of PHP, perhaps specifically in use with lighttpd,
- // return a blank string for PHP_SELF, so we use REQUEST_URI as a backup:
- //
- else if (sqgetGlobalVar('REQUEST_URI', $req_uri, SQ_SERVER)
- && !empty($req_uri)) {
+ // we may or may not have any query arguments, depending on
+ // which environment variable was used above, and the PHP
+ // version, etc., so let's check for it now
+ //
+ $query_string = '';
+ if (strpos($request_uri, '?') === FALSE
+ && sqgetGlobalVar('QUERY_STRING', $query_string, SQ_SERVER)
+ && !empty($query_string)) {