Changeset 777
- Timestamp:
- 10/23/2007 04:49:10 PM (3 years ago)
- Files:
-
- 1 modified
-
trunk/libs/Wakka.class.php (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/libs/Wakka.class.php
r775 r777 574 574 /** 575 575 * Generate a timestamp - OBSOLETE. 576 * 576 * 577 577 * DISABLED: replaced by getmicrotime() in Compatibility library! 578 578 * Left in place but returning just zero for now. … … 1163 1163 * @todo decide if we need (all) these methods! 1164 1164 * JW: my vote is NOT if all a getter does is return a variable directly; 1165 * but useful if there's some processing or checking involved - 1165 * but useful if there's some processing or checking involved - 1166 1166 * in which case an accompanying "setter" method should be used 1167 1167 * for creating/updating the variable - if only for consistency. … … 2780 2780 * to a wikkapage via XHTML tag attributes that expect a URL, such as href, 2781 2781 * src, or archive tags, or attributes in elements in XML/RSS. 2782 * 2782 * 2783 2783 * Its main purpose is to avoid "path confusion" when a relative URL would be 2784 2784 * attached to a <b>rewritten</b> (base) URL; without rewriting there's no … … 3017 3017 $tag = ''; // Href() will pick up current page name if none specified 3018 3018 } 3019 3019 3020 3020 // form action (action is a required attribute!) 3021 3021 // !!! If rewrite mode is off, "tag" has to be passed as a hidden field … … 3145 3145 function LogReferrer($tag = '', $referrer = '') 3146 3146 { 3147 /* better fix farther on 3147 3148 if (!isset($_SERVER['HTTP_REFERER'])) 3148 3149 { 3149 3150 return; #38 3150 3151 } 3152 */ 3151 3153 3152 3154 // fill values … … 3156 3158 $tag = $this->tag; 3157 3159 } 3158 if ( !$referrer = trim($referrer))3159 { 3160 $referrer = $_SERVER['HTTP_REFERER'];3161 } 3162 $referrer = $this->cleanUrl($referrer); # secured JW 2005-01-203160 if (empty($referrer)) 3161 { 3162 $referrer = (isset($_SERVER['HTTP_REFERER'])) ? $_SERVER['HTTP_REFERER'] : ''; #38 3163 } 3164 $referrer = trim($this->cleanUrl($referrer)); # secured JW 2005-01-20 3163 3165 3164 3166 // check if it's coming from another site 3165 3167 #if ($referrer && !preg_match('/^'.preg_quote($this->GetConfigValue('base_url'), '/').'/', $referrer)) 3166 if ( $referrer&& !preg_match('/^'.preg_quote($this->base_url, '/').'/', $referrer))3168 if (!empty($referrer) && !preg_match('/^'.preg_quote($this->base_url, '/').'/', $referrer)) 3167 3169 { 3168 3170 $parsed_url = parse_url($referrer); … … 3358 3360 * @access public 3359 3361 * @uses Wakka::GetConfigValue() 3360 * 3362 * 3361 3363 * @param string $handler handler name, optionally with appended parameters 3362 3364 * @return boolean TRUE if handler is found, FALSE otherwise … … 3438 3440 /** 3439 3441 * Authenticate a user from (persistent) cookies. 3440 * 3442 * 3441 3443 * @uses Wakka::GetConfigValue() 3442 3444 * @uses Wakka::LoadAll() … … 3606 3608 * {@link Wakka::existsUser()} or {@link Wakka::loadUserData()} depending on 3607 3609 * purpose!</b> 3608 * 3610 * 3609 3611 * ***Returns FALSE while still existing for reference.*** 3610 3612 *