Changeset 2357

Show
Ignore:
Timestamp:
03/27/08 04:45:08 (3 months ago)
Author:
Geert
Message:

Fixed #521

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/system/libraries/Validation.php

    r2344 r2357  
    607607        public function prep_url($str = '') 
    608608        { 
    609                 if ($str === '' OR $str === 'http://' OR $str === 'https://') 
     609                // Clear protocol-only strings like "http://" 
     610                if ($str === '' OR substr($str, -3) === '://') 
    610611                        return ''; 
    611612 
    612                 if (substr($str, 0, 7) !== 'http://' AND substr($str, 0, 8) !== 'https://') 
     613                // If no protocol given, prepend "http://" by default 
     614                if (strpos($str, '://') === FALSE) 
    613615                        return 'http://'.$str; 
     616 
     617                // Return the original URL 
     618                return $str; 
    614619        } 
    615620