From addbb8351784d33ba1c7ebc52771defd09ddf2f0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Fri, 15 Feb 2008 23:51:52 +0000 Subject: [PATCH] Notice fixed and RewriteEngine enabled in .htaccess --- .htaccess | 1 + inc/modules/guest/what-beg.php | 21 ++++++--------------- inc/session.php | 7 ++----- 3 files changed, 9 insertions(+), 20 deletions(-) diff --git a/.htaccess b/.htaccess index b6819a9c4f..bea521ae53 100644 --- a/.htaccess +++ b/.htaccess @@ -2,6 +2,7 @@ Options -Indexes DirectoryIndex index.php + RewriteEngine On RewriteRule ^cms/(.*)/wht/(.*)$ modules.php?module=$1&what=$2 [L] RewriteRule ^cms/(.*)/act/(.*)$ modules.php?module=$1&action=$2 [L] RewriteRule ^cms/(.*)$ modules.php?module=$1 [L] diff --git a/inc/modules/guest/what-beg.php b/inc/modules/guest/what-beg.php index 347b6f4d3c..887c393f1e 100644 --- a/inc/modules/guest/what-beg.php +++ b/inc/modules/guest/what-beg.php @@ -32,13 +32,10 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) -{ +if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); -} - elseif ((!EXT_IS_ACTIVE("beg")) && (!IS_ADMIN())) -{ +} elseif ((!EXT_IS_ACTIVE("beg")) && (!IS_ADMIN())) { ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "beg"); return; } @@ -49,24 +46,18 @@ ADD_DESCR("guest", basename(__FILE__)); // Prepare constants define('__BEG_POINTS' , TRANSLATE_COMMA($CONFIG['beg_points'])); define('__BEG_POINTS_MAX', TRANSLATE_COMMA($CONFIG['beg_points_max'])); -if ($ref > 0) -{ +if ($GLOBALS['refid'] > 0) { // Take referral ID from URL/Cookie define('__BEG_UID' , $ref); -} - else -{ +} else { // Take default referral ID define('__BEG_UID' , $CONFIG['def_refid']); } -if (function_exists('CREATE_FANCY_TIME')) -{ +if (function_exists('CREATE_FANCY_TIME')) { define('__BEG_TIMEOUT' , CREATE_FANCY_TIME($CONFIG['beg_timeout'])); define('__BEG_UID_TIMEOUT', CREATE_FANCY_TIME($CONFIG['beg_uid_timeout'])); -} - else -{ +} else { define('__BEG_TIMEOUT ' , round($CONFIG['beg_timeout'] / 60)." ".MINUTES); define('__BEG_UID_TIMEOUT', round($CONFIG['beg_uid_timeout'] / 60)." ".MINUTES); } diff --git a/inc/session.php b/inc/session.php index f977003be9..1d5a04c60b 100644 --- a/inc/session.php +++ b/inc/session.php @@ -47,15 +47,12 @@ if (empty($VIEW)) $VIEW = 0; if (($VIEW == 1) && ($_SERVER['PHP_SELF'])) return; // Session management initalization -if (empty($PHPSESSID)) -{ +if (empty($PHPSESSID)) { // This fixes some strange session cookie problems if (empty($_COOKIE['PHPSESSID'])) unset($_COOKIE['PHPSESSID']); @session_start(); $PHPSESSID = @session_id(); -} - else -{ +} else { @session_id($PHPSESSID); @session_start(); } -- 2.39.5