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

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