1
0
Fork 0
mirror of https://github.com/Oreolek/ifhub.club.git synced 2024-05-19 09:18:18 +03:00
This commit is contained in:
Mzhelskiy Maxim 2011-08-28 14:57:56 +00:00
parent d027889c9a
commit 85fec5588c

View file

@ -301,7 +301,7 @@ class ModuleImage extends Module {
* @param string $sPath
* @return string
*/
public function GetServerPath($sPath) {
public function GetServerPath($sPath) {
/**
* Определяем, принадлежит ли этот адрес основному домену
*/
@ -311,8 +311,11 @@ class ModuleImage extends Module {
/**
* Выделяем адрес пути
*/
$sPath = parse_url($sPath,PHP_URL_PATH);
return rtrim(Config::Get('path.root.server'),'/').'/'.ltrim($sPath,'/');
$sPath = ltrim(parse_url($sPath,PHP_URL_PATH),'/');
if($iOffset = Config::Get('path.offset_request_url')){
$sPath = preg_replace('#^([^/]+/*){'.$iOffset.'}#msi', '', $sPath);
}
return rtrim(Config::Get('path.root.server'),'/').'/'.$sPath;
}
/**
* Возвращает серверный адрес по переданному web-адресу