1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-31 20:00:37 +02:00

IN PROGRESS - Tasks EONE-10, EONE-11: more paths added, 'nice' urls are supported now (see thumb.php)

This commit is contained in:
secretr
2010-03-10 12:48:05 +00:00
parent c2e6caf631
commit 9f96a5bbd3
3 changed files with 74 additions and 13 deletions

View File

@@ -128,11 +128,11 @@ class e_thumbpage
}
$tp = e107::getParser();
// FIXME - better way, maybe additional e_parse method, returning path SC array only
$search = array('e_BASE/', 'e_IMAGE/', 'e_MEDIA/', 'e_PLUGIN/', 'e_THEME/', 'e_WEB/');
$replace = array('{e_BASE}', '{e_IMAGE}', '{e_MEDIA}', '{e_PLUGIN}', '{e_THEME}', '{e_WEB}');
$this->_request['src'] = str_replace($search, $replace,$this->_request['src']);
// convert raw to SC path
$this->_request['src'] = str_replace($tp->getUrlConstants('raw'), $tp->getUrlConstants('sc'), $this->_request['src']);
// convert absolute and full url to SC URL
$this->_src = $tp->createConstants($this->_request['src'], 'mix');
if(preg_match('#^(https?|ftps?|file)://#i', $this->_request['src']))
@@ -146,8 +146,8 @@ class e_thumbpage
return false;
}
// should be safe enough
$path = $tp->replaceConstants(str_replace('..', '', $this->_src));
// convert to relative server path
$path = $tp->replaceConstants(str_replace('..', '', $this->_src)); //should be safe enough
if(is_file($path) && is_readable($path))
{