Enabling streaming from Csutom Skin images
This commit is contained in:
@@ -145,6 +145,8 @@ $startingTime = array_sum(explode(' ',microtime()));
|
|||||||
$virtualURITable['/[a-zA-Z][a-zA-Z0-9]{0,}()'] = 'sysUnnamed';
|
$virtualURITable['/[a-zA-Z][a-zA-Z0-9]{0,}()'] = 'sysUnnamed';
|
||||||
$virtualURITable['/(*)'] = PATH_HTML;
|
$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 *****
|
//****** 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 )) {
|
if ( G::virtualURI($_SERVER['REQUEST_URI'], $virtualURITable , $realPath )) {
|
||||||
// review if the file requested belongs to public_html plugin
|
// review if the file requested belongs to public_html plugin
|
||||||
@@ -178,6 +180,40 @@ $startingTime = array_sum(explode(' ',microtime()));
|
|||||||
}
|
}
|
||||||
die;
|
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 ) {
|
switch ( $realPath ) {
|
||||||
case 'sysUnnamed' :
|
case 'sysUnnamed' :
|
||||||
require_once('sysUnnamed.php'); die;
|
require_once('sysUnnamed.php'); die;
|
||||||
|
|||||||
Reference in New Issue
Block a user