mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-30 07:42:11 +09:00
issue 3645, php5 대응, 함수 대체
git-svn-id: http://xe-core.googlecode.com/svn/branches/maserati@13202 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
5fa0bf23d7
commit
5693e340fe
28 changed files with 95 additions and 125 deletions
|
|
@ -250,7 +250,7 @@ class commentItem extends Object
|
|||
return;
|
||||
}
|
||||
|
||||
if(!preg_match("/^http:\/\//i", $url))
|
||||
if(strncasecmp('http://', $url, 7) !== 0)
|
||||
{
|
||||
$url = "http://" . $url;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -383,7 +383,7 @@ class documentItem extends Object
|
|||
|
||||
if($m[1] == 'param')
|
||||
{
|
||||
if(strpos(strtolower($m[0]), 'allowscriptaccess'))
|
||||
if(stripos($m[0], 'allowscriptaccess'))
|
||||
{
|
||||
$m[0] = '<param name="allowscriptaccess" value="never"';
|
||||
if(substr($m[0], -1) == '/')
|
||||
|
|
@ -395,7 +395,7 @@ class documentItem extends Object
|
|||
}
|
||||
else if($m[1] == 'embed')
|
||||
{
|
||||
if(strpos(strtolower($m[0]), 'allowscriptaccess'))
|
||||
if(stripos($m[0], 'allowscriptaccess'))
|
||||
{
|
||||
$m[0] = preg_replace('/always|samedomain/i', 'never', $m[0]);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -613,7 +613,7 @@ class layoutAdminController extends layout
|
|||
|
||||
foreach($file_list as $file)
|
||||
{
|
||||
if(preg_match('/^images/', $file)) continue;
|
||||
if(strncasecmp('images', $file, 6) === 0) continue;
|
||||
|
||||
// replace path
|
||||
$file = $target_path . $file;
|
||||
|
|
|
|||
|
|
@ -2116,7 +2116,7 @@ class memberController extends member
|
|||
|
||||
if($args->password)
|
||||
{
|
||||
if($this->useSha1 && function_exists('sha1'))
|
||||
if($this->useSha1)
|
||||
{
|
||||
$args->password = md5(sha1(md5($args->password)));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -333,7 +333,7 @@ class memberModel extends member
|
|||
{
|
||||
foreach($extra_vars as $key => $val)
|
||||
{
|
||||
if(!is_array($val)) if(preg_match('/\|\@\|/i', $val)) $val = explode('|@|', $val);
|
||||
if(!is_array($val) && strpos($val, '|@|') !== FALSE) $val = explode('|@|', $val);
|
||||
if(!$info->{$key}) $info->{$key} = $val;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -207,7 +207,7 @@ class menuAdminController extends menu
|
|||
|
||||
foreach($output->data as $itemInfo)
|
||||
{
|
||||
if($itemInfo->is_shortcut != 'Y' && !preg_match('/^http/i',$itemInfo->url))
|
||||
if($itemInfo->is_shortcut != 'Y' && strncasecmp('http', $itemInfo->url, 4) !== 0)
|
||||
{
|
||||
$moduleInfo = $oModuleModel->getModuleInfoByMid($itemInfo->url, $menuInfo->site_srl);
|
||||
if($moduleInfo->module_srl)
|
||||
|
|
@ -331,7 +331,7 @@ class menuAdminController extends menu
|
|||
$oDB->begin();
|
||||
|
||||
// type is url
|
||||
if(preg_match('/^http/i', $request->shortcut_target) || preg_match('/^(\.\/|\.\.\/|\/).*$/', $request->shortcut_target))
|
||||
if(strncasecmp('http', $request->shortcut_target, 4) === 0 || preg_match('/^(\.\/|\.\.\/|\/).*$/', $request->shortcut_target))
|
||||
{
|
||||
// set menu variable
|
||||
$args->menu_srl = $request->menu_srl;
|
||||
|
|
@ -414,7 +414,7 @@ class menuAdminController extends menu
|
|||
if($request->menu_name_key) $args->name = $request->menu_name_key;
|
||||
else $args->name = $request->menu_name;
|
||||
|
||||
if($request->module_id && preg_match('/^http/i', $request->module_id))
|
||||
if($request->module_id && strncasecmp('http', $request->module_id, 4) === 0)
|
||||
{
|
||||
return new Object(-1, 'msg_invalid_request');
|
||||
}
|
||||
|
|
@ -531,7 +531,7 @@ class menuAdminController extends menu
|
|||
if($itemInfo->is_shortcut == 'Y')
|
||||
{
|
||||
// type is url
|
||||
if(preg_match('/^http/i', $request->shortcut_target) || preg_match('/^(\.\/|\.\.\/|\/).*$/', $request->shortcut_target))
|
||||
if(strncasecmp('http', $request->shortcut_target, 4) === 0 || preg_match('/^(\.\/|\.\.\/|\/).*$/', $request->shortcut_target))
|
||||
{
|
||||
$args->url = $request->shortcut_target;
|
||||
}
|
||||
|
|
@ -813,7 +813,7 @@ class menuAdminController extends menu
|
|||
if($node['active_btn']) FileHandler::removeFile($node['active_btn']);
|
||||
|
||||
// Delete module
|
||||
if($node['is_shortcut'] != 'Y' && !preg_match('/^http/i',$node['url']))
|
||||
if($node['is_shortcut'] != 'Y' && strncasecmp('http', $node['url'], 4) !== 0)
|
||||
{
|
||||
$oModuleController = getController('module');
|
||||
$oModuleModel = &getModel('module');
|
||||
|
|
@ -1054,7 +1054,7 @@ class menuAdminController extends menu
|
|||
|
||||
$isModuleCopySuccess = false;
|
||||
// if menu have a reference of module instance
|
||||
if($menuItemInfo->is_shortcut == 'N' && !preg_match('/^http/i', $originMenu['url']))
|
||||
if($menuItemInfo->is_shortcut == 'N' && strncasecmp('http', $originMenu['url'], 4) !== 0 )
|
||||
{
|
||||
$oModuleModel = &getModel('module');
|
||||
$moduleInfo = $oModuleModel->getModuleInfoByMid($originMenu['url']);
|
||||
|
|
@ -1367,7 +1367,7 @@ class menuAdminController extends menu
|
|||
Context::set('error_messge', Context::getLang('msg_invalid_request'));
|
||||
|
||||
}
|
||||
else if(!$target_file || !is_uploaded_file($target_file['tmp_name']) || !preg_match('/\.(gif|jpeg|jpg|png)/i',$target_file['name']) || !checkUploadedFile($target_file['tmp_name']))
|
||||
else if(!$target_file || !is_uploaded_file($target_file['tmp_name']) || !preg_match('/\.(gif|jpeg|jpg|png)$/i',$target_file['name']) || !checkUploadedFile($target_file['tmp_name']))
|
||||
{
|
||||
Context::set('error_messge', Context::getLang('msg_invalid_request'));
|
||||
}
|
||||
|
|
@ -1748,13 +1748,13 @@ class menuAdminController extends menu
|
|||
$expand = $node->expand;
|
||||
|
||||
$normal_btn = $node->normal_btn;
|
||||
if($normal_btn && preg_match('/^\.\/files\/attach\/menu_button/i',$normal_btn)) $normal_btn = str_replace(array('&','"','<','>'),array('&','"','<','>'),$normal_btn);
|
||||
if($normal_btn && strncasecmp('./files/attach/menu_button', $normal_btn, 26) === 0) $normal_btn = str_replace(array('&','"','<','>'),array('&','"','<','>'),$normal_btn);
|
||||
else $normal_btn = '';
|
||||
$hover_btn = $node->hover_btn;
|
||||
if($hover_btn && preg_match('/^\.\/files\/attach\/menu_button/i',$hover_btn)) $hover_btn = str_replace(array('&','"','<','>'),array('&','"','<','>'),$hover_btn);
|
||||
if($hover_btn && strncasecmp('./files/attach/menu_button', $hover_btn, 26) === 0) $hover_btn = str_replace(array('&','"','<','>'),array('&','"','<','>'),$hover_btn);
|
||||
else $hover_btn = '';
|
||||
$active_btn = $node->active_btn;
|
||||
if($active_btn && preg_match('/^\.\/files\/attach\/menu_button/i',$active_btn)) $active_btn = str_replace(array('&','"','<','>'),array('&','"','<','>'),$active_btn);
|
||||
if($active_btn && strncasecmp('./files/attach/menu_button', $active_btn, 26) === 0) $active_btn = str_replace(array('&','"','<','>'),array('&','"','<','>'),$active_btn);
|
||||
else $active_btn = '';
|
||||
|
||||
$group_srls = $node->group_srls;
|
||||
|
|
@ -1864,17 +1864,18 @@ class menuAdminController extends menu
|
|||
$expand = $node->expand;
|
||||
|
||||
$normal_btn = $node->normal_btn;
|
||||
if($normal_btn && preg_match('/^\.\/files\/attach\/menu_button/i',$normal_btn)) $normal_btn = str_replace(array('&','"','<','>'),array('&','"','<','>'),$normal_btn);
|
||||
if($normal_btn && strncasecmp('./files/attach/menu_button', $normal_btn, 26) === 0) $normal_btn = str_replace(array('&','"','<','>'),array('&','"','<','>'),$normal_btn);
|
||||
else $normal_btn = '';
|
||||
|
||||
$hover_btn = $node->hover_btn;
|
||||
if($hover_btn && preg_match('/^\.\/files\/attach\/menu_button/i',$hover_btn)) $hover_btn = str_replace(array('&','"','<','>'),array('&','"','<','>'),$hover_btn);
|
||||
if($hover_btn && strncasecmp('./files/attach/menu_button', $hover_btn, 26) === 0) $hover_btn = str_replace(array('&','"','<','>'),array('&','"','<','>'),$hover_btn);
|
||||
else $hover_btn = '';
|
||||
|
||||
$active_btn = $node->active_btn;
|
||||
if($active_btn && preg_match('/^\.\/files\/attach\/menu_button/i',$active_btn)) $active_btn = str_replace(array('&','"','<','>'),array('&','"','<','>'),$active_btn);
|
||||
if($active_btn && strncasecmp('./files/attach/menu_button', $active_btn, 26) === 0) $active_btn = str_replace(array('&','"','<','>'),array('&','"','<','>'),$active_btn);
|
||||
else $active_btn = '';
|
||||
|
||||
|
||||
$group_srls = $node->group_srls;
|
||||
|
||||
if($normal_btn)
|
||||
|
|
|
|||
|
|
@ -178,7 +178,7 @@ class menuAdminModel extends menu
|
|||
{
|
||||
$menuItem->moduleType = null;
|
||||
}
|
||||
else if(!preg_match('/^http/i',$menuItem->url))
|
||||
else if(strncasecmp('http', $menuItem->url, 4) !== 0)
|
||||
{
|
||||
$oModuleModel = &getModel('module');
|
||||
$moduleInfo = $oModuleModel->getModuleInfoByMid($menuItem->url, 0);
|
||||
|
|
|
|||
|
|
@ -137,7 +137,7 @@ class menuAdminView extends menu
|
|||
function _menuInfoSetting(&$menu)
|
||||
{
|
||||
$oModuleModel = &getModel('module');
|
||||
if($menu['url'] && !preg_match('/^http/i', $menu['url']))
|
||||
if($menu['url'] && strncasecmp('http', $menu['url'], 4) !== 0)
|
||||
{
|
||||
unset($midInfo);
|
||||
unset($moduleInfo);
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ class menu extends ModuleObject
|
|||
}
|
||||
|
||||
// if url is empty, change type to shortcurt
|
||||
if($value2->is_shortcut == 'N' && (!$value2->url || preg_match('/^http/i',$value2->url)))
|
||||
if($value2->is_shortcut == 'N' && (!$value2->url || strncasecmp('http', $value2->url, 4) === 0))
|
||||
{
|
||||
$value2->is_shortcut = 'Y';
|
||||
$output3 = executeQuery('menu.updateMenuItem', $value2);
|
||||
|
|
@ -110,7 +110,7 @@ class menu extends ModuleObject
|
|||
{
|
||||
foreach($output2->data AS $key2=>$value2)
|
||||
{
|
||||
if(!empty($value2->url) && !preg_match('/^http/i',$value2->url))
|
||||
if(!empty($value2->url) && strncasecmp('http', $value2->url, 4) !== 0)
|
||||
{
|
||||
$moduleInfo = $oModuleModel->getModuleInfoByMid($value2->url);
|
||||
if(!$moduleInfo->module_srl)
|
||||
|
|
|
|||
|
|
@ -217,13 +217,13 @@ class pageView extends page
|
|||
return $matches[0];
|
||||
// In case of .. , get a path
|
||||
}
|
||||
else if(preg_match('/^\.\./i',$val))
|
||||
else if(strncasecmp('..', $val, 2) === 0))
|
||||
{
|
||||
$p = Context::pathToUrl($this->path);
|
||||
return sprintf("%s%s%s%s",$matches[1],$matches[2],$p.$val,$matches[4]);
|
||||
}
|
||||
|
||||
if(substr($val,0,2)=='./') $val = substr($val,2);
|
||||
if(strncasecmp('..', $val, 2) === 0) $val = substr($val,2);
|
||||
$p = Context::pathToUrl($this->path);
|
||||
$path = sprintf("%s%s%s%s",$matches[1],$matches[2],$p.$val,$matches[4]);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue