Changeset 1767

Show
Ignore:
Timestamp:
01/21/2008 08:15:21 AM (12 months ago)
Author:
Shadowhand
Message:

Small helper fixes:

  • Allowing feed::parse to load URLs as well as files and strings.
  • Remove @call in valid::url, in favor of setting error_reporting
  • Restored the is_string check for the action in form::open
Location:
trunk/system
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • trunk/system/core/Benchmark.php

    r1522 r1767  
    22/** 
    33 * Simple benchmarking. 
    4  *  
     4 * 
    55 * $Id$ 
    66 * 
  • trunk/system/helpers/feed.php

    r1725 r1767  
    2828 
    2929                // Allow loading by filename or raw XML string. 
    30                 $feed = is_file($feed) ? simplexml_load_file($feed) : simplexml_load_string($feed); 
     30                $feed = (is_file($feed) OR valid::url($feed)) ? simplexml_load_file($feed) : simplexml_load_string($feed); 
    3131 
    3232                // Restore error reporting 
  • trunk/system/helpers/form.php

    r1762 r1767  
    3131                } 
    3232 
    33                 if (empty($action)) 
     33                if (empty($action) OR ! is_string($action)) 
    3434                { 
    3535                        // Use the current URL as the default action 
  • trunk/system/helpers/valid.php

    r1764 r1767  
    6464                $scheme = strtolower($scheme); 
    6565 
     66                // Disable error reporting 
     67                $ER = error_reporting(0); 
     68 
    6669                // Use parse_url to validate the URL 
    67                 $url = @parse_url($url); 
     70                $url = parse_url($url); 
     71 
     72                // Restore error reporting 
     73                error_reporting($ER); 
    6874 
    6975                // If the boolean check returns TRUE, return FALSE, and vice versa