Changeset 19 in ExiteCMS8


Ignore:
Timestamp:
02/17/11 10:14:59 (15 months ago)
Author:
WanWizard
Message:

merged upstream fuel changes

Location:
trunk/fuel
Files:
2 added
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/fuel/core/classes/config.php

    r15 r19  
    9494 
    9595CONF; 
    96         $content .= 'return '.var_export($config, true).';'; 
     96        $content .= 'return '.str_replace('  ', "\t", var_export($config, true)).';'; 
    9797        $content .= <<<CONF 
    9898 
     
    100100/* End of file $file.php */ 
    101101CONF; 
    102         if ($path = \Fuel::find_file('config', $file, '.php')) 
    103         { 
    104             $path = $path[0]; 
    105         } 
    106         else 
    107         { 
    108             $path = APPPATH.'config'.DS.$file.'.php'; 
    109         } 
     102         
     103        ($path = \Fuel::find_file('config', $file, '.php')) or $path = APPPATH.'config'.DS.$file.'.php'; 
     104 
    110105        $path = pathinfo($path); 
    111106 
  • trunk/fuel/core/classes/database/exception.php

    r18 r19  
    1212namespace Fuel\Core; 
    1313 
    14 class Database_Exception extends Fuel_Exception {} 
     14class Database_Exception extends \Fuel_Exception {} 
  • trunk/fuel/core/classes/format.php

    r18 r19  
    8484        foreach ((array) $this->_data as $key => $value) 
    8585        { 
    86             if (is_object($value)) 
     86            if (is_object($value) or is_array($value)) 
    8787            { 
    8888                $array[$key] = static::to_array($value); 
     
    134134 
    135135            // replace anything not alpha numeric 
    136             $key = preg_replace('/[^a-z_]/i', '', $key); 
     136            $key = preg_replace('/[^a-z_\-0-9]/i', '', $key); 
    137137 
    138138            // if there is another array found recrusively call this function 
     
    150150                // add single node. 
    151151                $value = htmlspecialchars(html_entity_decode($value, ENT_QUOTES, 'UTF-8'), ENT_QUOTES, "UTF-8"); 
    152  
    153                 $UsedKeys[] = $key; 
    154152 
    155153                $structure->addChild($key, $value); 
  • trunk/fuel/core/classes/fuel.php

    r18 r19  
    202202     * @param   string  The name of the file 
    203203     * @param   string  The file extension 
     204     * @param   boolean if true return an array of all files found 
     205     * @param   boolean if false do not cache the result 
    204206     * @return  string  The path to the file 
    205207     */ 
    206     public static function find_file($directory, $file, $ext = '.php', $multiple = false) 
     208    public static function find_file($directory, $file, $ext = '.php', $multiple = false, $cache = true) 
    207209    { 
    208210        $path = $directory.DS.strtolower($file).$ext; 
     
    236238        } 
    237239 
    238         static::$path_cache[$path] = $found; 
     240        $cache and static::$path_cache[$path] = $found; 
    239241        static::$paths_changed = true; 
    240242 
  • trunk/fuel/core/classes/security.php

    r18 r19  
    114114    } 
    115115 
     116    public static function xss_clean($value) 
     117    { 
     118        if ( ! is_array($value)) 
     119        { 
     120            if ( ! function_exists('htmLawed')) 
     121            { 
     122                import('htmlawed/htmlawed', 'vendor'); 
     123            } 
     124 
     125            return htmLawed($value, array('safe' => 1)); 
     126        } 
     127         
     128        foreach ($value as $k => $v) 
     129        { 
     130            $value[$k] = static::xss_clean($v); 
     131        } 
     132 
     133        return $value; 
     134    } 
     135 
    116136    public static function strip_tags($value) 
    117137    { 
  • trunk/fuel/core/classes/view.php

    r13 r19  
    268268    public function set_filename($file) 
    269269    { 
    270         if (($path = \Fuel::find_file('views', $file)) === false) 
     270        if (($path = \Fuel::find_file('views', $file, '.php', false, false)) === false) 
    271271        { 
    272272            throw new \View_Exception('The requested view could not be found: '.\Fuel::clean_path($file)); 
  • trunk/fuel/packages/oil/classes/generate.php

    r18 r19  
    134134        if ( ! file_exists($app_template = APPPATH . 'views/template.php')) 
    135135        { 
    136             copy(PKGPATH . 'oil/views/template.php', $app_template); 
     136            copy(PKGPATH . 'oil/views/default/template.php', $app_template); 
    137137            chmod($app_template, 0666); 
    138138        } 
Note: See TracChangeset for help on using the changeset viewer.