mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-08 11:33:55 +09:00
#51 preg_match()를 substr_compare() 또는 strncmp()로 대체
This commit is contained in:
parent
681a9b2d07
commit
63e0fd6f3b
20 changed files with 68 additions and 61 deletions
|
|
@ -2256,11 +2256,11 @@ class Context
|
|||
{
|
||||
$filename = substr($filename, 2);
|
||||
}
|
||||
if(preg_match('/\.js$/i', $filename))
|
||||
if(substr_compare($filename, '.js', -3) === 0)
|
||||
{
|
||||
$self->loadFile(array($plugin_path . $filename, 'body', '', 0), TRUE);
|
||||
}
|
||||
elseif(preg_match('/\.css$/i', $filename))
|
||||
if(substr_compare($filename, '.css', -4) === 0)
|
||||
{
|
||||
$self->loadFile(array($plugin_path . $filename, 'all', '', 0), TRUE);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -859,7 +859,7 @@ class ModuleHandler extends Handler
|
|||
{
|
||||
if($val->type == 'image')
|
||||
{
|
||||
if(preg_match('/^\.\/files\/attach\/images\/(.+)/i', $val->value))
|
||||
if(strncmp('./files/attach/images/', $val->value, 22) === 0)
|
||||
{
|
||||
$val->value = Context::getRequestUri() . substr($val->value, 2);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -113,10 +113,11 @@ class Security
|
|||
{
|
||||
if(is_string($var))
|
||||
{
|
||||
if(!preg_match('/^\$user_lang->/', $var))
|
||||
if(strncmp('$user_lang->', $var, 12) !== 0)
|
||||
{
|
||||
$var = htmlspecialchars($var, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
|
||||
}
|
||||
|
||||
return $var;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue