Enabling streaming from Csutom Skin images

This commit is contained in:
Hugo Loza
2011-02-28 21:29:17 +00:00
parent 79e72fd716
commit c95d8d846d

View File

@@ -145,6 +145,8 @@ $startingTime = array_sum(explode(' ',microtime()));
$virtualURITable['/[a-zA-Z][a-zA-Z0-9]{0,}()'] = 'sysUnnamed';
$virtualURITable['/(*)'] = PATH_HTML;
//****** verify if we need to redirect or stream the file, if G:VirtualURI returns true means we are going to redirect the page *****
if ( G::virtualURI($_SERVER['REQUEST_URI'], $virtualURITable , $realPath )) {
// review if the file requested belongs to public_html plugin
@@ -178,6 +180,40 @@ $startingTime = array_sum(explode(' ',microtime()));
}
die;
}
$requestUriArray=explode("/",$_SERVER['REQUEST_URI']);
if((isset($requestUriArray[1]))&&($requestUriArray[1]=='skin')) {
/*
* By JHL Feb 28, 11
* This will allow to public images of Custom Skins
*/
$pathsQuery="";
//Get the query side
/*
* This way we remove garbage
*/
$forQuery=explode("?",$realPath);
if(isset($forQuery[1])) {
$pathsQuery=$forQuery[1];
}
//Get that path in array
$paths = explode ( PATH_SEP, $forQuery[0] );
$fileToBeStreamed=str_replace("/skin/",PATH_CUSTOM_SKINS,$_SERVER['REQUEST_URI']);
if ( file_exists ( $fileToBeStreamed ) ) {
G::streamFile ( $fileToBeStreamed );
}
die;
}
switch ( $realPath ) {
case 'sysUnnamed' :
require_once('sysUnnamed.php'); die;