mirror of
				https://github.com/smarty-php/smarty.git
				synced 2025-10-30 11:51:41 +01:00 
			
		
		
		
	add default_resource_type, ignore 1 char resource names
This commit is contained in:
		| @@ -25,11 +25,17 @@ function smarty_core_parse_file_path(&$params, &$this) | ||||
| 		 | ||||
|     if (count($_file_path_parts) == 1) { | ||||
|         // no resource type, treat as type "file" | ||||
|         $params['resource_type'] = 'file'; | ||||
|         $params['resource_type'] = $this->default_resource_type; | ||||
|         $params['resource_name'] = $_file_path_parts[0]; | ||||
|     } else { | ||||
|         $params['resource_type'] = $_file_path_parts[0]; | ||||
|         $params['resource_name'] = $_file_path_parts[1]; | ||||
| 		if(strlen($_file_path_parts[0]) == 1) { | ||||
| 			// 1 char is not resource type, but part of filepath | ||||
|         	$params['resource_type'] = $this->default_resource_type; | ||||
|         	$params['resource_name'] = $params['file_path'];			 | ||||
| 		} else { | ||||
|         	$params['resource_type'] = $_file_path_parts[0]; | ||||
|         	$params['resource_name'] = $_file_path_parts[1]; | ||||
| 		} | ||||
|         if ($params['resource_type'] != 'file') { | ||||
| 			$_params = array('type' => $params['resource_type']); | ||||
| 			$this->_execute_core_function('load_resource_plugin', $_params); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user