mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-01 00:02:21 +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
|
|
@ -105,7 +105,6 @@ class emoticon extends EditorHandler
|
|||
{
|
||||
$attr_output[] = "alt=\"".$alt."\"";
|
||||
}
|
||||
if(preg_match("/\.png$/i",$src)) $attr_output[] = "class=\"iePngFix\"";
|
||||
|
||||
$code = sprintf("<img %s style=\"border:0px\" />", implode(" ",$attr_output));
|
||||
|
||||
|
|
|
|||
|
|
@ -85,9 +85,6 @@ class image_link extends EditorHandler
|
|||
$style .= ' margin:'.$margin.'px;';
|
||||
}
|
||||
if($align) $attr_output[] = "align=\"".$align."\"";
|
||||
|
||||
if(preg_match("/\.png$/i",$src)) $attr_output[] = "class=\"iePngFix\"";
|
||||
|
||||
if($width) $attr_output[] = 'width="'.$width.'"';
|
||||
if($height) $attr_output[] = 'height="'.$height.'"';
|
||||
if($border)
|
||||
|
|
|
|||
|
|
@ -159,16 +159,23 @@ class editorController extends editor
|
|||
$content_style = $editor_config->content_style;
|
||||
if($content_style)
|
||||
{
|
||||
$path = _XE_PATH_.'modules/editor/styles/'.$content_style.'/';
|
||||
if(is_dir($path) && file_exists($path.'style.ini'))
|
||||
$path = _XE_PATH_ . 'modules/editor/styles/'.$content_style.'/';
|
||||
if(is_dir($path) && file_exists($path . 'style.ini'))
|
||||
{
|
||||
$ini = file($path.'style.ini');
|
||||
for($i=0,$c=count($ini);$i<$c;$i++)
|
||||
for($i = 0, $c = count($ini); $i < $c; $i++)
|
||||
{
|
||||
$file = trim($ini[$i]);
|
||||
if(!$file) continue;
|
||||
if(preg_match('/\.css$/i',$file)) Context::addCSSFile('./modules/editor/styles/'.$content_style.'/'.$file, false);
|
||||
elseif(preg_match('/\.js/i',$file)) Context::addJsFile('./modules/editor/styles/'.$content_style.'/'.$file, false);
|
||||
|
||||
if(substr_compare($file, '.css', -4) === 0)
|
||||
{
|
||||
Context::addCSSFile('./modules/editor/styles/'.$content_style.'/'.$file, false);
|
||||
}
|
||||
elseif(substr_compare($file, '.js', -3) === 0)
|
||||
{
|
||||
Context::addJsFile('./modules/editor/styles/'.$content_style.'/'.$file, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue