Changeset 2357
- Timestamp:
- 03/27/08 04:45:08 (3 months ago)
- Files:
-
- trunk/system/libraries/Validation.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/system/libraries/Validation.php
r2344 r2357 607 607 public function prep_url($str = '') 608 608 { 609 if ($str === '' OR $str === 'http://' OR $str === 'https://') 609 // Clear protocol-only strings like "http://" 610 if ($str === '' OR substr($str, -3) === '://') 610 611 return ''; 611 612 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) 613 615 return 'http://'.$str; 616 617 // Return the original URL 618 return $str; 614 619 } 615 620
