// Encodes an URL for adding session id, etc.
function encodeUrl ($url, $outputMode = '0') {
- // Do we have already have a PHPSESSID inside? Then it is already converted...
- if (strpos($url, session_name()) !== false) return $url;
+ // Do we have already have a PHPSESSID inside or view.php is called? Then abort here
+ if ((strpos($url, session_name()) !== false) || (getOutputMode() == -3)) return $url;
// Do we have a valid session?
if (((!isset($GLOBALS['valid_session'])) || ($GLOBALS['valid_session'] === false) || (!isset($_COOKIE[session_name()]))) && (isSpider() === false)) {
// Set module
$GLOBALS['module'] = 'view';
-$GLOBALS['output_mode'] = -1;
+$GLOBALS['output_mode'] = -3;
// Load the required file(s)
require('inc/config-global.php');