mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-04 01:01:41 +09:00
ereg를 모두 preg로 변경
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@3528 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
3a6cb4f7f2
commit
502b5a7a88
32 changed files with 75 additions and 75 deletions
|
|
@ -80,7 +80,7 @@
|
|||
list($lang_prefix, $lang_text) = explode(',',$val);
|
||||
$lang_text = trim($lang_text);
|
||||
$lang_supported[$lang_prefix] = $lang_text;
|
||||
if(!$this->lang_type && ereg($lang_prefix, strtolower($_SERVER['HTTP_ACCEPT_LANGUAGE']))) {
|
||||
if(!$this->lang_type && stripos($_SERVER['HTTP_ACCEPT_LANGUAGE'],$lang_prefix)!==false) {
|
||||
$this->lang_type = $lang_prefix;
|
||||
setcookie('lang_type', $this->lang_type, time()+60*60*24*365, '/');
|
||||
}
|
||||
|
|
@ -504,7 +504,7 @@
|
|||
**/
|
||||
function _setUploadedArgument() {
|
||||
if($this->_getRequestMethod() != 'POST') return;
|
||||
if(!eregi("^multipart\/form-data", $_SERVER['CONTENT_TYPE'])) return;
|
||||
if(stripos($_SERVER['CONTENT_TYPE'],"multipart/form-data")===false) return;
|
||||
if(!$_FILES) return;
|
||||
|
||||
foreach($_FILES as $key => $val) {
|
||||
|
|
@ -575,7 +575,7 @@
|
|||
} elseif($var_count == 2) {
|
||||
asort($var_keys);
|
||||
$target = implode('.',$var_keys);
|
||||
if($target=='act.mid' && !ereg('([A-Z]+)',$get_vars['act'])) return sprintf('%s%s/%s',$this->path,$get_vars['mid'],$get_vars['act']);
|
||||
if($target=='act.mid' && !preg_match('/([A-Z]+)/',$get_vars['act'])) return sprintf('%s%s/%s',$this->path,$get_vars['mid'],$get_vars['act']);
|
||||
elseif($target=='document_srl.mid') return sprintf('%s%s/%s',$this->path,$get_vars['mid'],$get_vars['document_srl']);
|
||||
elseif($target=='act.document_srl') return sprintf('%s%s/%s',$this->path,$get_vars['document_srl'],$get_vars['act']);
|
||||
elseif($target=='mid.page') return sprintf('%s%s/page/%s',$this->path,$get_vars['mid'],$get_vars['page']);
|
||||
|
|
@ -714,7 +714,7 @@
|
|||
function _addJsFile($file) {
|
||||
if(in_array($file, $this->js_files)) return;
|
||||
|
||||
if(!eregi("^http:\/\/",$file)) $file = str_replace(realpath("."), ".", realpath($file));
|
||||
if(stripos($file,'http://')===false) $file = str_replace(realpath("."), ".", realpath($file));
|
||||
$this->js_files[] = $file;
|
||||
}
|
||||
|
||||
|
|
@ -749,7 +749,7 @@
|
|||
function _addCSSFile($file) {
|
||||
if(in_array($file, $this->css_files)) return;
|
||||
|
||||
if(!eregi("^http:\/\/",$file)) $file = str_replace(realpath("."), ".", realpath($file));
|
||||
if(stripos($file,'http://')===false) $file = str_replace(realpath("."), ".", realpath($file));
|
||||
$this->css_files[] = $file;
|
||||
}
|
||||
|
||||
|
|
@ -890,8 +890,8 @@
|
|||
* @brief <!--Meta:파일이름.(css|js)-->를 변경
|
||||
**/
|
||||
function transMeta($matches) {
|
||||
if(eregi('\.css$', $matches[1])) $this->addCSSFile($matches[1]);
|
||||
elseif(eregi('\.js$', $matches[1])) $this->addJSFile($matches[1]);
|
||||
if(substr($matches[1],'-4')=='.css') $this->addCSSFile($matches[1]);
|
||||
elseif(substr($matches[1],'-3')=='.js') $this->addJSFile($matches[1]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@
|
|||
for($i=0;$i<count($supported_list);$i++) {
|
||||
$db_type = $supported_list[$i];
|
||||
|
||||
if(version_compare(phpversion(), '5.0') < 0 && eregi('pdo',$db_type)) continue;
|
||||
if(version_compare(phpversion(), '5.0') < 0 && stripos($db_type, 'pdo') !== false) continue;
|
||||
|
||||
$class_name = sprintf("DB%s%s", strtoupper(substr($db_type,0,1)), strtolower(substr($db_type,1)));
|
||||
$class_file = sprintf("./classes/db/%s.class.php", $class_name);
|
||||
|
|
@ -278,24 +278,24 @@
|
|||
switch($filter_type) {
|
||||
case 'email' :
|
||||
case 'email_address' :
|
||||
if(!eregi('^[_0-9a-z-]+(\.[_0-9a-z-]+)*@[0-9a-z-]+(\.[0-9a-z-]+)*$', $val)) return new Object(-1, sprintf($lang->filter->invalid_email, $lang->{$key}?$lang->{$key}:$key));
|
||||
if(!preg_match('/^[_0-9a-z-]+(\.[_0-9a-z-]+)*@[0-9a-z-]+(\.[0-9a-z-]+)*$/is', $val)) return new Object(-1, sprintf($lang->filter->invalid_email, $lang->{$key}?$lang->{$key}:$key));
|
||||
break;
|
||||
case 'homepage' :
|
||||
if(!eregi('^(http|https)+(:\/\/)+[0-9a-z_-]+\.[^ ]+$', $val)) return new Object(-1, sprintf($lang->filter->invalid_homepage, $lang->{$key}?$lang->{$key}:$key));
|
||||
if(!preg_match('/^(http|https)+(:\/\/)+[0-9a-z_-]+\.[^ ]+$/is', $val)) return new Object(-1, sprintf($lang->filter->invalid_homepage, $lang->{$key}?$lang->{$key}:$key));
|
||||
break;
|
||||
case 'userid' :
|
||||
case 'user_id' :
|
||||
if(!eregi('^[a-zA-Z]+([_0-9a-zA-Z]+)*$', $val)) return new Object(-1, sprintf($lang->filter->invalid_userid, $lang->{$key}?$lang->{$key}:$key));
|
||||
if(!preg_match('/^[a-zA-Z]+([_0-9a-zA-Z]+)*$/is', $val)) return new Object(-1, sprintf($lang->filter->invalid_userid, $lang->{$key}?$lang->{$key}:$key));
|
||||
break;
|
||||
case 'number' :
|
||||
case 'numbers' :
|
||||
if(!eregi('^[0-9,]+$', $val)) return new Object(-1, sprintf($lang->filter->invalid_number, $lang->{$key}?$lang->{$key}:$key));
|
||||
if(!preg_match('/^[0-9,]+$/is', $val)) return new Object(-1, sprintf($lang->filter->invalid_number, $lang->{$key}?$lang->{$key}:$key));
|
||||
break;
|
||||
case 'alpha' :
|
||||
if(!eregi('^[a-z]+$', $val)) return new Object(-1, sprintf($lang->filter->invalid_alpha, $lang->{$key}?$lang->{$key}:$key));
|
||||
if(!preg_match('/^[a-z]+$/is', $val)) return new Object(-1, sprintf($lang->filter->invalid_alpha, $lang->{$key}?$lang->{$key}:$key));
|
||||
break;
|
||||
case 'alpha_number' :
|
||||
if(!eregi('^[0-9a-z]+$', $val)) return new Object(-1, sprintf($lang->filter->invalid_alpha_number, $lang->{$key}?$lang->{$key}:$key));
|
||||
if(!preg_match('/^[0-9a-z]+$/is', $val)) return new Object(-1, sprintf($lang->filter->invalid_alpha_number, $lang->{$key}?$lang->{$key}:$key));
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@
|
|||
}
|
||||
|
||||
function isVaildMailAddress($email_address) {
|
||||
if( eregi("([a-z0-9\_\-\.]+)@([a-z0-9\_\-\.]+)", $email_address) ) return $email_address;
|
||||
if( preg_match("/([a-z0-9\_\-\.]+)@([a-z0-9\_\-\.]+)/i", $email_address) ) return $email_address;
|
||||
else return '';
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -57,9 +57,9 @@
|
|||
else $this->module_srl = (int)$module_srl;
|
||||
|
||||
// 기본 변수들의 검사 (XSS방지를 위한 기초적 검사)
|
||||
if($this->module && !eregi("^([a-z0-9\_\-]+)$",$this->module)) die(Context::getLang("msg_invalid_request"));
|
||||
if($this->mid && !eregi("^([a-z0-9\_\-]+)$",$this->mid)) die(Context::getLang("msg_invalid_request"));
|
||||
if($this->act && !eregi("^([a-z0-9\_\-]+)$",$this->act)) die(Context::getLang("msg_invalid_request"));
|
||||
if($this->module && !preg_match("/^([a-z0-9\_\-]+)$/i",$this->module)) die(Context::getLang("msg_invalid_request"));
|
||||
if($this->mid && !preg_match("/^([a-z0-9\_\-]+)$/i",$this->mid)) die(Context::getLang("msg_invalid_request"));
|
||||
if($this->act && !preg_match("/^([a-z0-9\_\-]+)$/i",$this->act)) die(Context::getLang("msg_invalid_request"));
|
||||
|
||||
// 애드온 실행 (모듈 실행 전)
|
||||
$called_position = 'before_module_init';
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@
|
|||
foreach($source_files as $file) {
|
||||
if(!$file) continue;
|
||||
$file = str_replace("\\","/",$file);
|
||||
if(eregi("^http:\/\/",$file) || $file == './common/css/button.css') $files[] = $file;
|
||||
if(substr($file,7)=='http://' || $file == './common/css/button.css') $files[] = $file;
|
||||
else $targets[] = $file;
|
||||
}
|
||||
|
||||
|
|
@ -105,7 +105,7 @@
|
|||
$content_buff .= $str."\n";
|
||||
}
|
||||
if($type == "css") $content_buff = '@charset "utf-8";'."\n".$content_buff;
|
||||
$content_file = eregi_replace("\.php$","",$filename);
|
||||
$content_file = substr($filename, 0, -1);
|
||||
$content_filename = str_replace($this->cache_path, '', $content_file);
|
||||
|
||||
FileHandler::writeFile($content_file, $content_buff);
|
||||
|
|
@ -152,7 +152,7 @@ exit();
|
|||
* @brief css의 경우 import/ background 등의 속성에서 사용되는 url내의 경로를 변경시켜줌
|
||||
**/
|
||||
function replaceCssPath($file, $str) {
|
||||
$this->tmp_css_path = Context::getRequestUri().ereg_replace("^\.\/","",dirname($file))."/";
|
||||
$this->tmp_css_path = Context::getRequestUri().preg_replace("/^\.\//is","",dirname($file))."/";
|
||||
$str = preg_replace_callback('!url\(("|\')?([^\)]+)("|\')?\)!is', array($this, '_replaceCssPath'), $str);
|
||||
|
||||
$str = preg_replace('!\/([^\/]*)\/\.\.\/!is','/', $str);
|
||||
|
|
@ -163,7 +163,7 @@ exit();
|
|||
}
|
||||
|
||||
function _replaceCssPath($matches) {
|
||||
if(eregi("^(http|\/|\.\/common\/)",$matches[2])) return $matches[0];
|
||||
if(preg_match("/^(http|\/|\.\/common\/)/is",$matches[2])) return $matches[0];
|
||||
return sprintf('url(%s%s)', $matches[1], $this->tmp_css_path.$matches[2]);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@
|
|||
if(__DEBUG__==3 ) $start = getMicroTime();
|
||||
|
||||
// 변수 체크
|
||||
$tpl_path = ereg_replace('(\/+)$', '', $tpl_path).'/';
|
||||
if(substr($tpl_path,-1)!='/') $tpl_path .= '/';
|
||||
if(substr($tpl_filename,-5)!='.html') $tpl_filename .= '.html';
|
||||
|
||||
// tpl_file 변수 생성
|
||||
|
|
@ -145,7 +145,7 @@
|
|||
$str1 = $matches[0];
|
||||
$str2 = $path = $matches[3];
|
||||
|
||||
if(!eregi("^([a-z0-9\_\.])",$path)) return $str1;
|
||||
if(!preg_match('/^([a-z0-9\_\.])/i',$path)) return $str1;
|
||||
|
||||
$path = preg_replace('/^(\.\/|\/)/','',$path);
|
||||
$path = '<?php echo $this->tpl_path?>'.$path;
|
||||
|
|
@ -205,7 +205,7 @@
|
|||
$tmp_arr = explode("/", $arg);
|
||||
for($i=0;$i<count($tmp_arr);$i++) {
|
||||
$item1 = trim($tmp_arr[$i]);
|
||||
if($item1=='.'||eregi("\.html$",$item1)) continue;
|
||||
if($item1=='.'||substr($item1,-5)=='.html') continue;
|
||||
|
||||
$tmp2_arr = explode(".",$item1);
|
||||
for($j=0;$j<count($tmp2_arr);$j++) {
|
||||
|
|
@ -260,7 +260,7 @@
|
|||
if(!$given_file) return;
|
||||
|
||||
// given_file이 lang으로 끝나게 되면 언어팩을 읽도록 함
|
||||
if(ereg('lang$', $given_file)) {
|
||||
if(substr($given_file, -4)=='lang') {
|
||||
if(substr($given_file,0,2)=='./') $given_file = substr($given_file, 2);
|
||||
$lang_dir = sprintf('%s%s', $this->tpl_path, $given_file);
|
||||
if(is_dir($lang_dir)) $output = sprintf('<?php Context::loadLang("%s"); ?>', $lang_dir);
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
* 2 : 1 + DB 쿼리
|
||||
* 3 : 모든 로그
|
||||
**/
|
||||
define('__DEBUG__', 0);
|
||||
define('__DEBUG__', 3);
|
||||
|
||||
/**
|
||||
* @brief 디버그 메세지의 출력 장소
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@
|
|||
}
|
||||
|
||||
// 이미지 파일이 아니어도 무시
|
||||
if(!eregi("\.(jpg|jpeg|gif|png)$", $image_obj['name'])) {
|
||||
if(!preg_match("/\.(jpg|jpeg|gif|png)$/i", $image_obj['name'])) {
|
||||
unset($obj->{$vars->name});
|
||||
continue;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@
|
|||
}
|
||||
|
||||
// 이미지 파일이 아니어도 무시
|
||||
if(!eregi("\.(jpg|jpeg|gif|png)$", $image_obj['name'])) {
|
||||
if(!preg_match("/\.(jpg|jpeg|gif|png)$/i", $image_obj['name'])) {
|
||||
unset($obj->{$vars->name});
|
||||
continue;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@
|
|||
if($oDocument->isLocked()) return new Object(-1,'msg_invalid_request');
|
||||
|
||||
if($obj->password) $obj->password = md5($obj->password);
|
||||
if($obj->homepage && !eregi('^http:\/\/',$obj->homepage)) $obj->homepage = 'http://'.$obj->homepage;
|
||||
if($obj->homepage && !preg_match('/^http:\/\//i',$obj->homepage)) $obj->homepage = 'http://'.$obj->homepage;
|
||||
|
||||
// 로그인 된 회원일 경우 회원의 정보를 입력
|
||||
if(Context::get('is_logged')) {
|
||||
|
|
@ -209,7 +209,7 @@
|
|||
if(!$is_admin && !$source_obj->isGranted()) return new Object(-1, 'msg_not_permitted');
|
||||
|
||||
if($obj->password) $obj->password = md5($obj->password);
|
||||
if($obj->homepage && !eregi('^http:\/\/',$obj->homepage)) $obj->homepage = 'http://'.$obj->homepage;
|
||||
if($obj->homepage && !preg_match('/^http:\/\//i',$obj->homepage)) $obj->homepage = 'http://'.$obj->homepage;
|
||||
|
||||
// 로그인 되어 있고 작성자와 수정자가 동일하면 수정자의 정보를 세팅
|
||||
if(Context::get('is_logged')) {
|
||||
|
|
|
|||
|
|
@ -123,7 +123,7 @@
|
|||
$url = trim($this->get('homepage'));
|
||||
if(!$url) return;
|
||||
|
||||
if(!eregi("^http:\/\/",$url)) $url = "http://".$url;
|
||||
if(!preg_match("/^http:\/\//i",$url)) $url = "http://".$url;
|
||||
|
||||
return $url;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -388,7 +388,7 @@
|
|||
if (is_dir($path."/".$entry)) {
|
||||
$this->deleteThumbnailFile($path."/".$entry);
|
||||
} else {
|
||||
if(!eregi('^thumbnail_([^\.]*)\.jpg$',$entry)) continue;
|
||||
if(!preg_match('/^thumbnail_([^\.]*)\.jpg$/i',$entry)) continue;
|
||||
@unlink($path.'/'.$entry);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@
|
|||
if($obj->allow_comment!='Y') $obj->allow_comment = 'N';
|
||||
if($obj->lock_comment!='Y') $obj->lock_comment = 'N';
|
||||
if($obj->allow_trackback!='Y') $obj->allow_trackback = 'N';
|
||||
if($obj->homepage && !eregi('^http:\/\/',$obj->homepage)) $obj->homepage = 'http://'.$obj->homepage;
|
||||
if($obj->homepage && !preg_match('/^http:\/\//i',$obj->homepage)) $obj->homepage = 'http://'.$obj->homepage;
|
||||
if($obj->notify_message != 'Y') $obj->notify_message = 'N';
|
||||
|
||||
// $extra_vars를 serialize
|
||||
|
|
@ -182,7 +182,7 @@
|
|||
if($obj->allow_comment!='Y') $obj->allow_comment = 'N';
|
||||
if($obj->lock_comment!='Y') $obj->lock_comment = 'N';
|
||||
if($obj->allow_trackback!='Y') $obj->allow_trackback = 'N';
|
||||
if($obj->homepage && !eregi('^http:\/\/',$obj->homepage)) $obj->homepage = 'http://'.$obj->homepage;
|
||||
if($obj->homepage && !preg_match('/^http:\/\//i',$obj->homepage)) $obj->homepage = 'http://'.$obj->homepage;
|
||||
if($obj->notify_message != 'Y') $obj->notify_message = 'N';
|
||||
|
||||
// $extra_vars를 serialize
|
||||
|
|
|
|||
|
|
@ -180,7 +180,7 @@
|
|||
$url = trim($this->get('homepage'));
|
||||
if(!$url) return;
|
||||
|
||||
if(!eregi("^http:\/\/",$url)) $url = "http://".$url;
|
||||
if(!preg_match("/^http:\/\//i",$url)) $url = "http://".$url;
|
||||
|
||||
return $url;
|
||||
}
|
||||
|
|
@ -441,7 +441,7 @@
|
|||
if(count($file_list)) {
|
||||
foreach($file_list as $file) {
|
||||
if($file->direct_download!='Y') continue;
|
||||
if(!eregi("(jpg|png|jpeg|gif)$",$file->source_filename)) continue;
|
||||
if(!preg_match("/(jpg|png|jpeg|gif)$/i",$file->source_filename)) continue;
|
||||
|
||||
$filename = $file->uploaded_filename;
|
||||
if(!file_exists($filename)) continue;
|
||||
|
|
@ -458,7 +458,7 @@
|
|||
preg_match_all("!http:\/\/([^ ^\"^']*?)\.(jpg|png|gif|jpeg)!is", $content, $matches, PREG_SET_ORDER);
|
||||
for($i=0;$i<count($matches);$i++) {
|
||||
$src = $matches[$i][0];
|
||||
if(ereg('\/(common|modules|widgets|addons|layouts)\/', $src)) continue;
|
||||
if(preg_match('/\/(common|modules|widgets|addons|layouts)\//i', $src)) continue;
|
||||
else {
|
||||
$target_src = $src;
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
function emoticon($editor_sequence, $component_path) {
|
||||
$this->editor_sequence = $editor_sequence;
|
||||
$this->component_path = $component_path;
|
||||
$this->emoticon_path = sprintf('%s%s/images',eregi_replace('^\.\/','',$this->component_path),'tpl','images');
|
||||
$this->emoticon_path = sprintf('%s%s/images',preg_replace('/^\.\//i','',$this->component_path),'tpl','images');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -26,7 +26,7 @@
|
|||
**/
|
||||
function getEmoticonList() {
|
||||
$emoticon = Context::get('emoticon');
|
||||
if(!$emoticon || !eregi("^([a-z0-9\_]+)$",$emoticon)) return new Object(-1,'msg_invalid_request');
|
||||
if(!$emoticon || !preg_replace("/^([a-z0-9\_]+)$/i",$emoticon)) return new Object(-1,'msg_invalid_request');
|
||||
|
||||
$list = $this->getEmoticons($emoticon);
|
||||
|
||||
|
|
@ -43,7 +43,7 @@
|
|||
$oDir = dir($emoticon_path);
|
||||
while($file = $oDir->read()) {
|
||||
if(substr($file,0,1)=='.') continue;
|
||||
if(eregi('\.(jpg|jpeg|gif|png)$',$file)) $output[] = sprintf("%s/%s", $path, str_replace($this->emoticon_path,'',$file));
|
||||
if(preg_match('/\.(jpg|jpeg|gif|png)$/i',$file)) $output[] = sprintf("%s/%s", $path, str_replace($this->emoticon_path,'',$file));
|
||||
}
|
||||
$oDir->close();
|
||||
if(count($output)) asort($output);
|
||||
|
|
@ -91,7 +91,7 @@
|
|||
if($alt) {
|
||||
$attr_output[] = "alt=\"".$alt."\"";
|
||||
}
|
||||
if(eregi("\.png$",$src)) $attr_output[] = "class=\"iePngFix\"";
|
||||
if(preg_match("/\.png$/i",$src)) $attr_output[] = "class=\"iePngFix\"";
|
||||
|
||||
$code = sprintf("<img %s style=\"border:0px\" />", implode(" ",$attr_output));
|
||||
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@
|
|||
}
|
||||
if($align) $attr_output[] = "align=\"".$align."\"";
|
||||
|
||||
if(eregi("\.png$",$src)) $attr_output[] = "class=\"iePngFix\"";
|
||||
if(preg_match("/\.png$/i",$src)) $attr_output[] = "class=\"iePngFix\"";
|
||||
|
||||
if($width) $attr_output[] = 'width="'.$width.'"';
|
||||
if($height) $attr_output[] = 'height="'.$height.'"';
|
||||
|
|
|
|||
|
|
@ -339,7 +339,7 @@
|
|||
}
|
||||
|
||||
// 이미지인지 기타 파일인지 체크하여 upload path 지정
|
||||
if(eregi("\.(jpg|jpeg|gif|png|wmv|wma|mpg|mpeg|avi|swf|flv|mp3|asaf|wav|asx|midi)$", $file_info['name'])) {
|
||||
if(preg_match("/\.(jpg|jpeg|gif|png|wmv|wma|mpg|mpeg|avi|swf|flv|mp3|asaf|wav|asx|midi)$/i", $file_info['name'])) {
|
||||
$path = sprintf("./files/attach/images/%s/%s/", $module_srl,$upload_target_srl);
|
||||
$filename = $path.$file_info['name'];
|
||||
$direct_download = 'Y';
|
||||
|
|
@ -474,7 +474,7 @@
|
|||
$old_file = $file_info->uploaded_filename;
|
||||
|
||||
// 이미지인지 기타 파일인지 체크하여 이동할 위치 정함
|
||||
if(eregi("\.(jpg|jpeg|gif|png|wmv|wma|mpg|mpeg|avi|swf|flv|mp3|asaf|wav|asx|midi)$", $file_info->source_filename)) {
|
||||
if(preg_match("/\.(jpg|jpeg|gif|png|wmv|wma|mpg|mpeg|avi|swf|flv|mp3|asaf|wav|asx|midi)$/i", $file_info->source_filename)) {
|
||||
$path = sprintf("./files/attach/images/%s/%s/", $target_module_srl,$target_srl);
|
||||
$new_file = $path.$file_info->source_filename;
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -202,7 +202,7 @@
|
|||
}
|
||||
|
||||
// 이미지 파일이 아니어도 무시
|
||||
if(!eregi("\.(jpg|jpeg|gif|png)$", $image_obj['name'])) {
|
||||
if(!preg_match("/\.(jpg|jpeg|gif|png)$/i", $image_obj['name'])) {
|
||||
unset($obj->{$vars->name});
|
||||
continue;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@
|
|||
if(!$xml_file) return new Object(-1, 'msg_no_xml_file');
|
||||
|
||||
// local 파일 지정인데 파일이 없으면 역시 에러~
|
||||
if(!eregi('^http:',$xml_file) && (!eregi("\.xml$", $xml_file) || !file_exists($xml_file)) ) return new Object(-1,'msg_no_xml_file');
|
||||
if(!preg_match('/^http:/i',$xml_file) && (!preg_match("/\.xml$/i", $xml_file) || !file_exists($xml_file)) ) return new Object(-1,'msg_no_xml_file');
|
||||
|
||||
// 이제부터 데이터를 가져오면서 처리
|
||||
$fp = $this->getFilePoint($xml_file);
|
||||
|
|
@ -163,8 +163,8 @@
|
|||
**/
|
||||
function importMember($obj) {
|
||||
// homepage, blog의 url을 정확히 만듬
|
||||
if($obj->homepage && !eregi("^http:\/\/",$obj->homepage)) $obj->homepage = 'http://'.$obj->homepage;
|
||||
if($obj->blog && !eregi("^http:\/\/",$obj->blog)) $obj->blog = 'http://'.$obj->blog;
|
||||
if($obj->homepage && !preg_match("/^http:\/\//i",$obj->homepage)) $obj->homepage = 'http://'.$obj->homepage;
|
||||
if($obj->blog && !preg_match("/^http:\/\//i",$obj->blog)) $obj->blog = 'http://'.$obj->blog;
|
||||
|
||||
$obj->email_address = $obj->email;
|
||||
list($obj->email_id, $obj->email_host) = explode('@', $obj->email);
|
||||
|
|
@ -257,7 +257,7 @@
|
|||
if(!$xml_file) return new Object(-1, 'msg_no_xml_file');
|
||||
|
||||
// local 파일 지정인데 파일이 없으면 역시 에러~
|
||||
if(!eregi('^http:',$xml_file) && (!eregi("\.xml$", $xml_file) || !file_exists($xml_file)) ) return new Object(-1,'msg_no_xml_file');
|
||||
if(!preg_match('/^http:/i',$xml_file) && (!preg_match("/\.xml$/i", $xml_file) || !file_exists($xml_file)) ) return new Object(-1,'msg_no_xml_file');
|
||||
|
||||
// 이제부터 데이터를 가져오면서 처리
|
||||
$fp = $this->getFilePoint($xml_file);
|
||||
|
|
@ -398,7 +398,7 @@
|
|||
if(!$xml_file) return new Object(-1, 'msg_no_xml_file');
|
||||
|
||||
// local 파일 지정인데 파일이 없으면 역시 에러~
|
||||
if(!eregi('^http:',$xml_file) && (!eregi("\.xml$", $xml_file) || !file_exists($xml_file)) ) return new Object(-1,'msg_no_xml_file');
|
||||
if(!preg_match('/^http:/i',$xml_file) && (!preg_match("/\.xml$/i", $xml_file) || !file_exists($xml_file)) ) return new Object(-1,'msg_no_xml_file');
|
||||
|
||||
// 필요한 객체 미리 생성
|
||||
$this->oDocumentController = &getController('document');
|
||||
|
|
@ -813,7 +813,7 @@
|
|||
**/
|
||||
function getFilePoint($filename) {
|
||||
$fp = null;
|
||||
if(eregi('^http:', $filename)) {
|
||||
if(preg_match('/^http:/i', $filename)) {
|
||||
$url_info = parse_url($filename);
|
||||
if(!$url_info['port']) $url_info['port'] = 80;
|
||||
if(!$url_info['path']) $url_info['path'] = '/';
|
||||
|
|
@ -902,7 +902,7 @@
|
|||
if(!$xml_file) return new Object(-1, 'msg_no_xml_file');
|
||||
|
||||
// local 파일 지정인데 파일이 없으면 역시 에러~
|
||||
if(!eregi('^http:',$xml_file) && (!eregi("\.xml$", $xml_file) || !file_exists($xml_file)) ) return new Object(-1,'msg_no_xml_file');
|
||||
if(!preg_match('/^http:/i',$xml_file) && (!preg_match("/\.xml$/i", $xml_file) || !file_exists($xml_file)) ) return new Object(-1,'msg_no_xml_file');
|
||||
|
||||
// 필요한 객체 미리 생성
|
||||
$this->oDocumentController = &getController('document');
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@
|
|||
}
|
||||
|
||||
// 이미지 파일이 아니어도 무시
|
||||
if(!eregi("\.(jpg|jpeg|gif|png)$", $image_obj['name'])) {
|
||||
if(!preg_match("/\.(jpg|jpeg|gif|png)$/i", $image_obj['name'])) {
|
||||
unset($obj->{$vars->name});
|
||||
continue;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@
|
|||
if(!$image_obj['tmp_name'] || !is_uploaded_file($image_obj['tmp_name'])) continue;
|
||||
|
||||
// 이미지 파일이 아니어도 무시 (swf는 패스~)
|
||||
if(!eregi("\.(jpg|jpeg|gif|png|swf)$", $image_obj['name'])) continue;
|
||||
if(!preg_match("/\.(jpg|jpeg|gif|png|swf)$/i", $image_obj['name'])) continue;
|
||||
|
||||
// 경로를 정해서 업로드
|
||||
$path = sprintf("./files/attach/images/%s/", $args->layout_srl);
|
||||
|
|
|
|||
|
|
@ -200,7 +200,7 @@
|
|||
}
|
||||
|
||||
// 이미지 파일이 아니어도 무시
|
||||
if(!eregi("\.(jpg|jpeg|gif|png)$", $image_obj['name'])) {
|
||||
if(!preg_match("/\.(jpg|jpeg|gif|png)$/i", $image_obj['name'])) {
|
||||
unset($obj->{$vars->name});
|
||||
continue;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1264,7 +1264,7 @@
|
|||
if(!$member_info->member_srl) return;
|
||||
|
||||
// 오픈아이디인지 체크 (일단 아이디 형식으로만 결정)
|
||||
if(eregi("^([0-9a-z]+)$", $member_info->user_id)) $member_info->is_openid = false;
|
||||
if(preg_match("/^([0-9a-z]+)$/is", $member_info->user_id)) $member_info->is_openid = false;
|
||||
else $member_info->is_openid = true;
|
||||
|
||||
// 로그인 처리를 위한 세션 설정
|
||||
|
|
@ -1330,8 +1330,8 @@
|
|||
list($args->email_id, $args->email_host) = explode('@', $args->email_address);
|
||||
|
||||
// 홈페이지, 블로그의 주소 검사
|
||||
if($args->homepage && !eregi("^http:\/\/",$args->homepage)) $args->homepage = 'http://'.$args->homepage;
|
||||
if($args->blog && !eregi("^http:\/\/",$args->blog)) $args->blog = 'http://'.$args->blog;
|
||||
if($args->homepage && !preg_match("/^http:\/\//i",$args->homepage)) $args->homepage = 'http://'.$args->homepage;
|
||||
if($args->blog && !preg_match("/^http:\/\//i",$args->blog)) $args->blog = 'http://'.$args->blog;
|
||||
|
||||
// 모델 객체 생성
|
||||
$oMemberModel = &getModel('member');
|
||||
|
|
@ -1433,8 +1433,8 @@
|
|||
list($args->email_id, $args->email_host) = explode('@', $args->email_address);
|
||||
|
||||
// 홈페이지, 블로그의 주소 검사
|
||||
if($args->homepage && !eregi("^http:\/\/",$args->homepage)) $args->homepage = 'http://'.$args->homepage;
|
||||
if($args->blog && !eregi("^http:\/\/",$args->blog)) $args->blog = 'http://'.$args->blog;
|
||||
if($args->homepage && !preg_match("/^http:\/\//is",$args->homepage)) $args->homepage = 'http://'.$args->homepage;
|
||||
if($args->blog && !preg_match("/^http:\/\//is",$args->blog)) $args->blog = 'http://'.$args->blog;
|
||||
|
||||
// 아이디, 닉네임, email address 의 중복 체크
|
||||
$member_srl = $oMemberModel->getMemberSrlByUserID($args->user_id);
|
||||
|
|
|
|||
|
|
@ -146,7 +146,7 @@
|
|||
unset($info->extra_vars);
|
||||
if(!$extra_vars) return $info;
|
||||
foreach($extra_vars as $key => $val) {
|
||||
if(eregi('\|\@\|', $val)) $val = explode('|@|', $val);
|
||||
if(preg_match('/\|\@\|/i', $val)) $val = explode('|@|', $val);
|
||||
if(!$info->{$key}) $info->{$key} = $val;
|
||||
}
|
||||
return $info;
|
||||
|
|
|
|||
|
|
@ -130,7 +130,7 @@
|
|||
$xml_file = $this->makeXmlFile($args->menu_srl);
|
||||
|
||||
// url이 mid일 경우 기록 남김
|
||||
if(eregi('^([a-zA-Z0-9\_\-]+)$', $args->url)) {
|
||||
if(preg_match('/^([a-zA-Z0-9\_\-]+)$/', $args->url)) {
|
||||
$mid = $args->url;
|
||||
|
||||
$mid_args->menu_srl = $args->menu_srl;
|
||||
|
|
@ -337,7 +337,7 @@
|
|||
$name_str = sprintf('$_names = array(%s); print $_names[$_SESSION["lang_type"]];', $name_arr_str);
|
||||
|
||||
$url = str_replace(array('&','"','<','>'),array('&','"','<','>'),$node->url);
|
||||
if(eregi('^([0-9a-zA-Z\_\-]+)$', $node->url)) $href = getUrl('','mid',$node->url);
|
||||
if(preg_match('/^([0-9a-zA-Z\_\-]+)$/', $node->url)) $href = getUrl('','mid',$node->url);
|
||||
else $href = $url;
|
||||
$open_window = $node->open_window;
|
||||
$expand = $node->expand;
|
||||
|
|
@ -407,7 +407,7 @@
|
|||
// 변수 정리
|
||||
$href = str_replace(array('&','"','<','>'),array('&','"','<','>'),$node->href);
|
||||
$url = str_replace(array('&','"','<','>'),array('&','"','<','>'),$node->url);
|
||||
if(eregi('^([0-9a-zA-Z\_\-]+)$', $node->url)) $href = getUrl('','mid',$node->url);
|
||||
if(preg_match('/^([0-9a-zA-Z\_\-]+)$/i', $node->url)) $href = getUrl('','mid',$node->url);
|
||||
else $href = $url;
|
||||
$open_window = $node->open_window;
|
||||
$normal_btn = str_replace(array('&','"','<','>'),array('&','"','<','>'),$node->normal_btn);
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@
|
|||
|
||||
function _replaceSrc($matches) {
|
||||
$href = $matches[4];
|
||||
if(eregi("^http", $href) || $href == '#' || eregi("javascript:",$href)) return $matches[0];
|
||||
if(preg_match("/^http/i", $href) || $href == '#' || preg_match("/javascript:/i",$href)) return $matches[0];
|
||||
|
||||
if(substr($href,0,1)=='/') $href = substr($href,1);
|
||||
$href = $this->target_path.$href;
|
||||
|
|
@ -96,7 +96,7 @@
|
|||
|
||||
function _replaceBackgroundUrl($matches) {
|
||||
$href = $matches[1];
|
||||
if(eregi("^http",$href) || $href == '#' || eregi("javascript:",$href)) return $matches[0];
|
||||
if(preg_match("/^http/i",$href) || $href == '#' || preg_match("/javascript:/i",$href)) return $matches[0];
|
||||
|
||||
if(substr($href,0,1)=='/') $href = substr($href,1);
|
||||
$href = $this->target_path.$href;
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@
|
|||
$cache_file = sprintf("./files/cache/opage/%d.cache.php", $module_info->module_srl);
|
||||
|
||||
// http 인지 내부 파일인지 점검
|
||||
if(eregi("^http:\/\/",$path)) $content = $this->getHtmlPage($path, $caching_interval, $cache_file);
|
||||
if(preg_match("/^http:\/\//i",$path)) $content = $this->getHtmlPage($path, $caching_interval, $cache_file);
|
||||
else $content = $this->executeFile($path, $caching_interval, $cache_file);
|
||||
|
||||
Context::set('opage_content', $content);
|
||||
|
|
@ -97,7 +97,7 @@
|
|||
// 경로와 파일이름을 구함
|
||||
$tmp_path = explode('/',$cache_file);
|
||||
$filename = $tmp_path[count($tmp_path)-1];
|
||||
$filepath = ereg_replace($filename."$","",$cache_file);
|
||||
$filepath = preg_replace('/'.$filename."$/i","",$cache_file);
|
||||
|
||||
// 캐시 검사
|
||||
if($caching_interval <1 || !file_exists($cache_file) || filemtime($cache_file) + $caching_interval*60 <= time() || filemtime($cache_file)<filemtime($path) ) {
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@
|
|||
$vars = Context::getRequestVars();
|
||||
foreach($vars as $key => $val) {
|
||||
if(strpos($key,'tidx')) continue;
|
||||
if(!eregi("^(title|checkcount|item)_", $key)) continue;
|
||||
if(!preg_match("/^(title|checkcount|item)_/i", $key)) continue;
|
||||
if(!trim($val)) continue;
|
||||
|
||||
$tmp_arr = explode('_',$key);
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@
|
|||
$count = count($word_list);
|
||||
for($i=0;$i<$count;$i++) {
|
||||
$word = $word_list[$i]->word;
|
||||
if(eregi($word, $text)!==false) return new Object(-1,sprintf(Context::getLang('msg_alert_denied_word'), $word));
|
||||
if(preg_match('/'.$word.'/is', $text)) return new Object(-1,sprintf(Context::getLang('msg_alert_denied_word'), $word));
|
||||
}
|
||||
|
||||
return new Object();
|
||||
|
|
|
|||
|
|
@ -200,7 +200,7 @@
|
|||
}
|
||||
|
||||
// 이미지 파일이 아니어도 무시
|
||||
if(!eregi("\.(jpg|jpeg|gif|png)$", $image_obj['name'])) {
|
||||
if(!preg_match("/\.(jpg|jpeg|gif|png)$/i", $image_obj['name'])) {
|
||||
unset($obj->{$vars->name});
|
||||
continue;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -286,7 +286,7 @@
|
|||
// 결과를 기다림 (특정 서버의 경우 EOF가 떨어지지 않을 수가 있음
|
||||
while(!feof($fp)) {
|
||||
$line = trim(fgets($fp, 4096));
|
||||
if(eregi("^<error>",$line)) break;
|
||||
if(preg_match("/^<error>/i",$line)) break;
|
||||
}
|
||||
|
||||
// socket 닫음
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@
|
|||
fclose($fp);
|
||||
|
||||
$encoding = preg_match("/<\?xml.*encoding=\"(.+)\".*\?>/i", $buff, $matches);
|
||||
if($encoding && !eregi("UTF-8", $matches[1])) $buff = trim(iconv($matches[1]=="ks_c_5601-1987"?"EUC-KR":$matches[1], "UTF-8", $buff));
|
||||
if($encoding && !preg_match("/UTF-8/i", $matches[1])) $buff = trim(iconv($matches[1]=="ks_c_5601-1987"?"EUC-KR":$matches[1], "UTF-8", $buff));
|
||||
|
||||
$buff = preg_replace("/<\?xml.*\?>/i", "", $buff);
|
||||
|
||||
|
|
@ -99,4 +99,4 @@
|
|||
return $output;
|
||||
}
|
||||
}
|
||||
?>
|
||||
?>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue