Changeset 777

Show
Ignore:
Timestamp:
10/23/2007 04:49:10 PM (3 years ago)
Author:
JavaWoman
Message:

merging NOTICE fix from 1.1.6.4 [776] back to trunk

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/libs/Wakka.class.php

    r775 r777  
    574574        /** 
    575575         * Generate a timestamp - OBSOLETE. 
    576          *  
     576         * 
    577577         * DISABLED: replaced by getmicrotime() in Compatibility library! 
    578578         * Left in place but returning just zero for now. 
     
    11631163         * @todo        decide if we need (all) these methods! 
    11641164         *                      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 - 
    11661166         *                      in which case an accompanying "setter" method should be used 
    11671167         *                      for creating/updating the variable - if only for consistency. 
     
    27802780         * to a wikkapage via XHTML tag attributes that expect a URL, such as href, 
    27812781         * src, or archive tags, or attributes in elements in XML/RSS. 
    2782          *  
     2782         * 
    27832783         * Its main purpose is to avoid "path confusion" when a relative URL would be 
    27842784         * attached to a <b>rewritten</b> (base) URL; without rewriting there's no 
     
    30173017                        $tag = '';      // Href() will pick up current page name if none specified 
    30183018                } 
    3019                  
     3019 
    30203020                // form action (action is a required attribute!) 
    30213021                // !!! If rewrite mode is off, "tag" has to be passed as a hidden field 
     
    31453145        function LogReferrer($tag = '', $referrer = '') 
    31463146        { 
     3147                /* better fix farther on 
    31473148                if (!isset($_SERVER['HTTP_REFERER'])) 
    31483149                { 
    31493150                        return; #38 
    31503151                } 
     3152                */ 
    31513153 
    31523154                // fill values 
     
    31563158                        $tag = $this->tag; 
    31573159                } 
    3158                 if (!$referrer = trim($referrer)) 
    3159                 { 
    3160                         $referrer = $_SERVER['HTTP_REFERER']; 
    3161                 } 
    3162                 $referrer = $this->cleanUrl($referrer);                 # secured JW 2005-01-20 
     3160                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 
    31633165 
    31643166                // check if it's coming from another site 
    31653167                #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)) 
    31673169                { 
    31683170                        $parsed_url = parse_url($referrer); 
     
    33583360         * @access      public 
    33593361         * @uses        Wakka::GetConfigValue() 
    3360          *  
     3362         * 
    33613363         * @param       string  $handler        handler name, optionally with appended parameters 
    33623364         * @return      boolean TRUE if handler is found, FALSE otherwise 
     
    34383440        /** 
    34393441         * Authenticate a user from (persistent) cookies. 
    3440          *  
     3442         * 
    34413443         * @uses        Wakka::GetConfigValue() 
    34423444         * @uses        Wakka::LoadAll() 
     
    36063608         * {@link Wakka::existsUser()} or {@link Wakka::loadUserData()} depending on 
    36073609         * purpose!</b> 
    3608          *  
     3610         * 
    36093611         * ***Returns FALSE while still existing for reference.*** 
    36103612         *