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:
khongchi 2013-11-13 01:40:53 +00:00
parent 5fa0bf23d7
commit 5693e340fe
28 changed files with 95 additions and 125 deletions

View file

@ -11,7 +11,7 @@ if(!defined('__XE__'))
*/
$logged_info = Context::get('logged_info');
$act = Context::get('act');
$kind = strpos(strtolower($act), 'admin') !== false ? 'admin' : '';
$kind = stripos($act, 'admin') !== false ? 'admin' : '';
if($called_position == 'before_module_proc' && $kind == 'admin' && $logged_info->is_admin == 'Y')
{

View file

@ -21,15 +21,16 @@ function memberTransImageName($matches)
$oMemberModel = getModel('member');
$nick_name = $matches[5];
$_tmp = &$GLOBALS['_transImageNameList'][$member_srl];
// If pre-defined data in the global variablesm return it
if(!$GLOBALS['_transImageNameList'][$member_srl]->cached)
if(!$_tmp->cached)
{
$GLOBALS['_transImageNameList'][$member_srl]->cached = true;
$_tmp->cached = true;
$image_name_file = sprintf('files/member_extra_info/image_name/%s%d.gif', getNumberingPath($member_srl), $member_srl);
$image_mark_file = sprintf('files/member_extra_info/image_mark/%s%d.gif', getNumberingPath($member_srl), $member_srl);
if(file_exists($image_name_file))
{
$GLOBALS['_transImageNameList'][$member_srl]->image_name_file = $image_name_file;
$_tmp->image_name_file = $image_name_file;
}
else
{
@ -37,7 +38,7 @@ function memberTransImageName($matches)
}
if(file_exists($image_mark_file))
{
$GLOBALS['_transImageNameList'][$member_srl]->image_mark_file = $image_mark_file;
$_tmp->image_mark_file = $image_mark_file;
}
else
{
@ -46,13 +47,13 @@ function memberTransImageName($matches)
$site_module_info = Context::get('site_module_info');
$group_image = $oMemberModel->getGroupImageMark($member_srl, $site_module_info->site_srl);
$GLOBALS['_transImageNameList'][$member_srl]->group_image = $group_image;
$_tmp->group_image = $group_image;
}
else
{
$group_image = $GLOBALS['_transImageNameList'][$member_srl]->group_image;
$image_name_file = $GLOBALS['_transImageNameList'][$member_srl]->image_name_file;
$image_mark_file = $GLOBALS['_transImageNameList'][$member_srl]->image_mark_file;
$group_image = $_tmp->group_image;
$image_name_file = $_tmp->image_name_file;
$image_mark_file = $_tmp->image_mark_file;
}
// If image name and mark doesn't exist, set the original information
if(!$image_name_file && !$image_mark_file && !$group_image)

View file

@ -189,13 +189,13 @@ class mobileXE
$userAgent = $_SERVER['HTTP_USER_AGENT'];
$wap_sid = $_SERVER['HTTP_X_UP_SUBNO'];
if(preg_match("/SKT11/i", $userAgent) || preg_match("/skt/i", $browserAccept))
if(stripos($userAgent, "SKT11") !== FALSE || stripos($browserAccept, "skt") !== FALSE)
{
Context::set('mobile_skt',1);
return "wml";
}
elseif(preg_match("/hdml/i", $browserAccept)) return "hdml";
elseif(preg_match("/CellPhone/i", $userAgent)) return "mhtml";
elseif(stripos($browserAccept, "hdml") !== FALSE) return "hdml";
elseif(stripos($userAgent, "cellphone") !== FALSE) return "mhtml";
return null;
}

View file

@ -388,11 +388,7 @@ class Context
*/
function close()
{
// Session Close
if(function_exists('session_write_close'))
{
session_write_close();
}
session_write_close();
// DB close
$oDB = DB::getInstance();
@ -440,7 +436,7 @@ class Context
unset($db_info->db_userid);
$db_info->master_db["db_table_prefix"] = $db_info->db_table_prefix;
unset($db_info->db_table_prefix);
if(substr($db_info->master_db["db_table_prefix"], -1) != '_')
if(substr_compare($db_info->master_db["db_table_prefix"], '_', -1) !== 0)
{
$db_info->master_db["db_table_prefix"] .= '_';
}
@ -620,7 +616,7 @@ class Context
{
return true;
}
if(substr($default_url, -1) != '/')
if(substr_compare($default_url, '/', -1) !== 0)
{
$default_url .= '/';
}
@ -841,7 +837,7 @@ class Context
return;
}
if(substr($path, -1) != '/')
if(substr_compare($path, '/', -1) !== 0)
{
$path .= '/';
}
@ -865,7 +861,7 @@ class Context
*/
function _loadXmlLang($path)
{
if(substr($path, -1) != '/')
if(substr_compare($path, '/', -1) !== 0)
{
$path .= '/';
}
@ -885,7 +881,7 @@ class Context
*/
function _loadPhpLang($path)
{
if(substr($path, -1) != '/')
if(substr_compare($path, '/', -1) !== 0)
{
$path .= '/';
}
@ -1257,7 +1253,7 @@ class Context
foreach($val as $k => $v)
{
if($key === 'page' || $key === 'cpage' || substr($key, -3) === 'srl')
if($key === 'page' || $key === 'cpage' || substr_compare($key, 'srl', -3) === 0)
{
$val[$k] = !preg_match('/^[0-9,]+$/', $v) ? (int) $v : $v;
}
@ -1452,7 +1448,7 @@ class Context
else
{
$domain = preg_replace('/^(http|https):\/\//i', '', trim($domain));
if(substr($domain, -1) != '/')
if(substr_compare($domain, '/', -1) !== 0)
{
$domain .= '/';
}
@ -1699,7 +1695,7 @@ class Context
if($domain)
{
$target_url = trim($domain);
if(substr($target_url, -1) != '/')
if(substr_compare($target_url, '/', -1) !== 0)
{
$target_url.= '/';
}
@ -2227,7 +2223,7 @@ class Context
continue;
}
if(substr($filename, 0, 2) == './')
if(strncasecmp('./', $filename, 2) === 0)
{
$filename = substr($filename, 2);
}
@ -2287,7 +2283,7 @@ class Context
continue;
}
if(substr($filename, 0, 2) == './')
if(strncasecmp('./', $filename, 2) === 0)
{
$filename = substr($filename, 2);
}
@ -2506,7 +2502,7 @@ class Context
}
$path = '/' . implode('/', $_path);
if(substr($path, -1) != '/')
if(substr_compare($path, '/', -1) !== 0)
{
$path .= '/';
}

View file

@ -1043,7 +1043,7 @@ class DBCubrid extends DB
// Check for distinct query and if found update count query structure
$temp_select = $queryObject->getSelectString($with_values);
$uses_distinct = strpos(strtolower($temp_select), "distinct") !== FALSE;
$uses_distinct = stripos($temp_select, "distinct") !== FALSE;
$uses_groupby = $queryObject->getGroupByString() != '';
if($uses_distinct || $uses_groupby)
{

View file

@ -932,7 +932,7 @@ class DBMssql extends DB
// Check for distinct query and if found update count query structure
$temp_select = $queryObject->getSelectString(true);
$uses_distinct = strpos(strtolower($temp_select), "distinct") !== false;
$uses_distinct = stripos($temp_select, "distinct") !== false;
$uses_groupby = $queryObject->getGroupByString() != '';
if($uses_distinct || $uses_groupby)
{

View file

@ -751,7 +751,7 @@ class DBMysql extends DB
// Check for distinct query and if found update count query structure
$temp_select = $queryObject->getSelectString($with_values);
$uses_distinct = strpos(strtolower($temp_select), "distinct") !== false;
$uses_distinct = stripos($temp_select, "distinct") !== false;
$uses_groupby = $queryObject->getGroupByString() != '';
if($uses_distinct || $uses_groupby)
{

View file

@ -38,7 +38,7 @@ class HTMLDisplayHandler
if(count($theme_skin) == 2)
{
$theme_path = sprintf('./themes/%s', $theme_skin[0]);
if(substr($theme_path, 0, strlen($theme_path)) != $theme_path)
if(substr_compare($theme_path, $theme_path, 0, strlen($theme_path)) !== 0)
{
$template_path = sprintf('%s/modules/%s/', $theme_path, $theme_skin[1]);
}
@ -117,7 +117,7 @@ class HTMLDisplayHandler
// if popup_layout, remove admin bar.
$realLayoutPath = FileHandler::getRealPath($layout_path);
if(substr($realLayoutPath, -1) != '/')
if(substr_compare($realLayoutPath, '/', -1) !== 0)
{
$realLayoutPath .= '/';
}
@ -135,7 +135,7 @@ class HTMLDisplayHandler
$GLOBALS['__layout_compile_elapsed__'] = getMicroTime() - $start;
}
if(preg_match('/MSIE/i', $_SERVER['HTTP_USER_AGENT']) && (Context::get('_use_ssl') == 'optional' || Context::get('_use_ssl') == 'always'))
if(stripos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== FALSE && (Context::get('_use_ssl') == 'optional' || Context::get('_use_ssl') == 'always'))
{
Context::addHtmlFooter('<iframe id="xeTmpIframe" name="xeTmpIframe" style="width:1px;height:1px;position:absolute;top:-2px;left:-2px;"></iframe>');
}

View file

@ -16,7 +16,7 @@ class VirtualXMLDisplayHandler
$redirect_url = $oModule->get('redirect_url');
$request_uri = Context::get('xeRequestURI');
$request_url = Context::get('xeVirtualRequestUrl');
if(substr($request_url, -1) != '/')
if(substr_compare($request_url, '/', -1) !== 0)
{
$request_url .= '/';
}

View file

@ -80,7 +80,7 @@ class ModuleHandler extends Handler
exit;
}
if(isset($this->act) && substr($this->act, 0, 4) == 'disp')
if(isset($this->act) && substr_compare($this->act, 'disp', 0, 4) === 0)
{
if(Context::get('_use_ssl') == 'optional' && Context::isExistsSSLAction($this->act) && $_SERVER['HTTPS'] != 'on')
{
@ -349,7 +349,7 @@ class ModuleHandler extends Handler
// get type, kind
$type = $xml_info->action->{$this->act}->type;
$ruleset = $xml_info->action->{$this->act}->ruleset;
$kind = strpos(strtolower($this->act), 'admin') !== FALSE ? 'admin' : '';
$kind = stripos($this->act, 'admin') !== FALSE ? 'admin' : '';
if(!$kind && $this->module == 'admin')
{
$kind = 'admin';
@ -475,7 +475,7 @@ class ModuleHandler extends Handler
if($forward->module && $forward->type && $forward->act && $forward->act == $this->act)
{
$kind = strpos(strtolower($forward->act), 'admin') !== FALSE ? 'admin' : '';
$kind = stripos($forward->act, 'admin') !== FALSE ? 'admin' : '';
$type = $forward->type;
$ruleset = $forward->ruleset;
$tpl_path = $oModule->getTemplatePath();
@ -920,7 +920,7 @@ class ModuleHandler extends Handler
$isLayoutDrop = Context::get('isLayoutDrop');
if($isLayoutDrop)
{
$kind = strpos(strtolower($this->act), 'admin') !== FALSE ? 'admin' : '';
$kind = stripos($this->act, 'admin') !== FALSE ? 'admin' : '';
if($kind == 'admin')
{
$oModule->setLayoutFile('popup_layout');

View file

@ -44,7 +44,7 @@ class ModuleObject extends Object
* */
function setModulePath($path)
{
if(substr($path, -1) != '/')
if(substr_compare($path, '/', -1) !== 0)
{
$path.='/';
}
@ -251,7 +251,7 @@ class ModuleObject extends Object
* */
function setTemplateFile($filename)
{
if(substr($filename, -5) != '.html')
if(substr_compare($filename, '.html', -5) !== 0)
{
$filename .= '.html';
}
@ -274,11 +274,11 @@ class ModuleObject extends Object
* */
function setTemplatePath($path)
{
if(substr($path, 0, 1) != '/' && substr($path, 0, 2) != './')
if(substr_compare($path, '/', 0, 1) !== 0 && substr_compare($path, './', 0, 2) !== 0)
{
$path = './' . $path;
}
if(substr($path, -1) != '/')
if(substr_compare($path, '/', -1) !== 0)
{
$path .= '/';
}
@ -301,7 +301,7 @@ class ModuleObject extends Object
* */
function setEditedLayoutFile($filename)
{
if(substr($filename, -5) != '.html')
if(substr_compare($filename, '.html', -5) !== 0)
{
$filename .= '.html';
}
@ -324,7 +324,7 @@ class ModuleObject extends Object
* */
function setLayoutFile($filename)
{
if(substr($filename, -5) != '.html')
if(substr_compare($filename, '.html', -5) !== 0)
{
$filename .= '.html';
}
@ -346,11 +346,11 @@ class ModuleObject extends Object
* */
function setLayoutPath($path)
{
if(substr($path, 0, 1) != '/' && substr($path, 0, 2) != './')
if(substr_compare($path, '/', 0, 1) !== 0 && substr_compare($path, './', 0, 2) !== 0)
{
$path = './' . $path;
}
if(substr($path, -1) != '/')
if(substr_compare($path, '/', -1) !== 0)
{
$path .= '/';
}

View file

@ -569,7 +569,7 @@ class EmbedFilter
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) == '/')
@ -581,7 +581,7 @@ class EmbedFilter
}
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]);
}

View file

@ -321,7 +321,7 @@ class DBParser
{
return $column_name;
}
if(strpos(strtolower($column_name), 'distinct') !== FALSE)
if(stripos($column_name, 'distinct') !== FALSE)
{
return $column_name;
}

View file

@ -63,7 +63,7 @@ xe.msg_select_menu = "{$lang->msg_select_menu}";
</script>
</head>
{@$isAdminKind = false}
<!--@if(strpos(strtolower(Context::get('act')),'admin') || Context::get('module') == 'admin')-->
<!--@if(stripos(Context::get('act'),'admin') || Context::get('module') == 'admin')-->
{@$isAdminKind = true}
<!--@end-->
<body{Context::getBodyClass()}>

View file

@ -22,22 +22,6 @@ if(!function_exists('iconv'))
');
}
if(!function_exists('htmlspecialchars_decode'))
{
/**
* Decode html special characters
*
* @param string $text
* @return string
*/
function htmlspecialchars_decode($text)
{
return strtr($text, array_flip(get_html_translation_table(HTML_SPECIALCHARS)));
}
}
/**
* Time zone
* @var array
@ -343,7 +327,7 @@ function getFullUrl()
}
$url = Context::getUrl($num_args, $args_list);
if(!preg_match('/^http/i', $url))
if(strncasecmp('http', $url, 4) !== 0)
{
preg_match('/^(http|https):\/\/([^\/]+)\//', $request_uri, $match);
return substr($match[0], 0, -1) . $url;
@ -367,7 +351,7 @@ function getNotEncodedFullUrl()
}
$url = Context::getUrl($num_args, $args_list, NULL, FALSE);
if(!preg_match('/^http/i', $url))
if(strncasecmp('http', $url, 4) !== 0)
{
preg_match('/^(http|https):\/\/([^\/]+)\//', $request_uri, $match);
$url = Context::getUrl($num_args, $args_list, NULL, FALSE);
@ -440,7 +424,7 @@ function getFullSiteUrl()
$num_args = count($args_list);
$url = Context::getUrl($num_args, $args_list, $domain);
if(!preg_match('/^http/i', $url))
if(strncasecmp('http', $url, 4) !== 0)
{
preg_match('/^(http|https):\/\/([^\/]+)\//', $request_uri, $match);
return substr($match[0], 0, -1) . $url;
@ -456,7 +440,7 @@ function getFullSiteUrl()
*/
function isSiteID($domain)
{
return preg_match('/^([a-z0-9\_]+)$/i', $domain);
return preg_match('/^([a-zA-Z0-9\_]+)$/', $domain);
}
/**
@ -785,14 +769,9 @@ function debugPrint($debug_output = NULL, $display_option = TRUE, $file = '_debu
{
$firephp = FirePHP::getInstance(TRUE);
}
if(function_exists("memory_get_usage"))
{
$label = sprintf('[%s:%d] (m:%s)', $file_name, $line_num, FileHandler::filesize(memory_get_usage()));
}
else
{
$label = sprintf('[%s:%d] ', $file_name, $line_num);
}
$label = sprintf('[%s:%d] (m:%s)', $file_name, $line_num, FileHandler::filesize(memory_get_usage()));
// Check a FirePHP option
if($display_option === 'TABLE')
{
@ -814,14 +793,7 @@ function debugPrint($debug_output = NULL, $display_option = TRUE, $file = '_debu
return;
}
$debug_file = _XE_PATH_ . 'files/' . $file;
if(function_exists("memory_get_usage"))
{
$debug_output = sprintf("[%s %s:%d] - mem(%s)\n%s\n", date('Y-m-d H:i:s'), $file_name, $line_num, FileHandler::filesize(memory_get_usage()), print_r($debug_output, TRUE));
}
else
{
$debug_output = sprintf("[%s %s:%d]\n%s\n", date('Y-m-d H:i:s'), $file_name, $line_num, print_r($debug_output, TRUE));
}
$debug_output = sprintf("[%s %s:%d] - mem(%s)\n%s\n", date('Y-m-d H:i:s'), $file_name, $line_num, FileHandler::filesize(memory_get_usage()), print_r($debug_output, TRUE));
if($display_option === TRUE)
{
@ -1043,7 +1015,7 @@ function removeSrcHack($match)
{
foreach($m[1] as $idx => $name)
{
if(substr($name, 0, 2) == 'on')
if(substr_compare($name, 'on', 0, 2) === 0)
{
continue;
}
@ -1073,7 +1045,7 @@ function removeSrcHack($match)
$attribute = strtolower(trim($name));
if($attribute == 'data' || $attribute == 'src' || $attribute == 'href')
{
if(strpos(strtolower($val), 'data:') === 0)
if(stripos($val, 'data:') === 0)
{
continue;
}
@ -1083,7 +1055,7 @@ function removeSrcHack($match)
if($tag == 'img')
{
$attribute = strtolower(trim($name));
if(strpos(strtolower($val), 'data:') === 0)
if(stripos($val, 'data:') === 0)
{
continue;
}
@ -1169,7 +1141,7 @@ function getScriptPath()
static $url = NULL;
if($url == NULL)
{
$url = preg_replace('/\/tools\//i', '/', preg_replace('/index.php$/i', '', str_replace('\\', '/', $_SERVER['SCRIPT_NAME'])));
$url = str_ireplace('/tools/', '/', preg_replace('/index.php$/i', '', str_replace('\\', '/', $_SERVER['SCRIPT_NAME'])));
}
return $url;
}

View file

@ -250,7 +250,7 @@ class commentItem extends Object
return;
}
if(!preg_match("/^http:\/\//i", $url))
if(strncasecmp('http://', $url, 7) !== 0)
{
$url = "http://" . $url;
}

View file

@ -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]);
}

View file

@ -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;

View 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)));
}

View file

@ -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;
}
}

View file

@ -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('&amp;','&quot;','&lt;','&gt;'),$normal_btn);
if($normal_btn && strncasecmp('./files/attach/menu_button', $normal_btn, 26) === 0) $normal_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$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('&amp;','&quot;','&lt;','&gt;'),$hover_btn);
if($hover_btn && strncasecmp('./files/attach/menu_button', $hover_btn, 26) === 0) $hover_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$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('&amp;','&quot;','&lt;','&gt;'),$active_btn);
if($active_btn && strncasecmp('./files/attach/menu_button', $active_btn, 26) === 0) $active_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$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('&amp;','&quot;','&lt;','&gt;'),$normal_btn);
if($normal_btn && strncasecmp('./files/attach/menu_button', $normal_btn, 26) === 0) $normal_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$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('&amp;','&quot;','&lt;','&gt;'),$hover_btn);
if($hover_btn && strncasecmp('./files/attach/menu_button', $hover_btn, 26) === 0) $hover_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$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('&amp;','&quot;','&lt;','&gt;'),$active_btn);
if($active_btn && strncasecmp('./files/attach/menu_button', $active_btn, 26) === 0) $active_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$active_btn);
else $active_btn = '';
$group_srls = $node->group_srls;
if($normal_btn)

View file

@ -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);

View file

@ -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);

View file

@ -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)

View file

@ -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]);

View file

@ -465,7 +465,7 @@ class content extends WidgetHandler
$buff = $this->requestFeedContents($args->rss_url);
$encoding = preg_match("/<\?xml.*encoding=\"(.+)\".*\?>/i", $buff, $matches);
if($encoding && !preg_match("/UTF-8/i", $matches[1])) $buff = Context::convertEncodingStr($buff);
if($encoding && stripos($matches[1], "UTF-8") === FALSE) $buff = Context::convertEncodingStr($buff);
$buff = preg_replace("/<\?xml.*\?>/i", "", $buff);
@ -602,7 +602,7 @@ class content extends WidgetHandler
$content_item->setContentsLink($rss->link);
if($item->title)
{
if(!preg_match("/html/i", $value->title->attrs->type)) $item->title = $value->title->body;
if(stripos($value->title->attrs->type, "html") === FALSE) $item->title = $value->title->body;
}
$content_item->setTitle($item->title);
$content_item->setNickName(max($item->author,$item->{'dc:creator'}));
@ -611,14 +611,14 @@ class content extends WidgetHandler
$item->description = preg_replace('!<a href=!is','<a onclick="window.open(this.href);return false" href=', $item->content);
if($item->description)
{
if(!preg_match("/html/i", $value->content->attrs->type)) $item->description = htmlspecialchars($item->description);
if(stripos($value->content->attrs->type, "html") === FALSE) $item->description = htmlspecialchars($item->description);
}
if(!$item->description)
{
$item->description = $item->summary;
if($item->description)
{
if(!preg_match("/html/i", $value->summary->attrs->type)) $item->description = htmlspecialchars($item->description);
if(stripos($value->summary->attrs->type, "html") === FALSE) $item->description = htmlspecialchars($item->description);
}
}
$content_item->setContent($this->_getSummary($item->description, $args->content_cut_size));

View file

@ -33,7 +33,7 @@ class login_info extends WidgetHandler
$useSsl = Context::getSslStatus();
if($useSsl != 'none')
{
if(preg_match('/^https:\/\//i', Context::getRequestUri())) $ssl_mode = true;
if(strncasecmp('https://', Context::getRequestUri(), 8) === 0) $ssl_mode = true;
}
Context::set('ssl_mode',$ssl_mode);

View file

@ -414,7 +414,7 @@ class mcontent extends WidgetHandler
$buff = $this->requestFeedContents($args->rss_url);
$encoding = preg_match("/<\?xml.*encoding=\"(.+)\".*\?>/i", $buff, $matches);
if($encoding && !preg_match("/UTF-8/i", $matches[1])) $buff = Context::convertEncodingStr($buff);
if($encoding && stripos($matches[1], "UTF-8") === FALSE) $buff = Context::convertEncodingStr($buff);
$buff = preg_replace("/<\?xml.*\?>/i", "", $buff);
@ -548,7 +548,7 @@ class mcontent extends WidgetHandler
$content_item->setContentsLink($rss->link);
if($item->title)
{
if(!preg_match("/html/i", $value->title->attrs->type)) $item->title = $value->title->body;
if(stripos($value->title->attrs->type, "html") === FALSE) $item->title = $value->title->body;
}
$content_item->setTitle($item->title);
$content_item->setNickName(max($item->author,$item->{'dc:creator'}));
@ -557,14 +557,14 @@ class mcontent extends WidgetHandler
$item->description = preg_replace('!<a href=!is','<a onclick="window.open(this.href);return false" href=', $item->content);
if($item->description)
{
if(!preg_match("/html/i", $value->content->attrs->type)) $item->description = htmlspecialchars($item->description);
if(stripos($value->summary->attrs->type, "html") === FALSE) $item->description = htmlspecialchars($item->description);
}
if(!$item->description)
{
$item->description = $item->summary;
if($item->description)
{
if(!preg_match("/html/i", $value->summary->attrs->type)) $item->description = htmlspecialchars($item->description);
if(stripos($value->summary->attrs->type, "html") === FALSE) $item->description = htmlspecialchars($item->description);
}
}
$content_item->setContent($this->_getSummary($item->description, $args->content_cut_size));