- Timestamp:
- Nov 1, 2006, 6:04:24 AM (18 years ago)
- Location:
- trunk/include
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/functions.inc.php
r1578 r1589 185 185 function get_filename_wo_extension( $filename ) 186 186 { 187 return substr( $filename, 0, strrpos( $filename, '.' ) ); 187 $pos = strrpos( $filename, '.' ); 188 return ($pos===false) ? $filename : substr( $filename, 0, $pos); 188 189 } 189 190 -
trunk/include/template.php
r1587 r1589 148 148 149 149 /** 150 * fills $output template var 151 */ 152 function parse($handle )150 * fills $output template var by default or returns the content 151 */ 152 function parse($handle, $return=false) 153 153 { 154 154 if (!$this->loadfile($handle)) … … 167 167 $_str = ''; 168 168 eval($this->compiled_code[$handle]); 169 if ($return) 170 { 171 return $_str; 172 } 169 173 $this->output.= $_str; 170 174 … … 303 307 { 304 308 // Check if it's an absolute or relative path. 305 if (substr($filename, 0, 1) != '/' 306 and substr($filename, 0, 1) != '\\' //Windows UNC path 307 and !preg_match('/^[a-z]:\\\/i', $filename) ) 309 // if (substr($filename, 0, 1) != '/') 310 if (preg_match('/^[a-z_][^:]/i', $filename) ) 308 311 { 309 312 $filename = $this->root.'/'.$filename;
Note: See TracChangeset
for help on using the changeset viewer.