diff --git a/.htaccess b/.htaccess index 89ecf951f..43536f5e9 100644 --- a/.htaccess +++ b/.htaccess @@ -15,37 +15,7 @@ RewriteRule ^(.+)/files/(member_extra_info|attach|cache|faceOff)/(.*) ./files/$2 RewriteCond %{SCRIPT_FILENAME} !-f RewriteRule ^(.+)/(files|modules|widgets|widgetstyles|layouts|m.layouts|addons)/(.*) ./$2/$3 [L] -# rss , blogAPI -RewriteRule ^(rss|atom)$ ./index.php?module=rss&act=$1 [L] -RewriteRule ^([a-zA-Z0-9_]+)/(rss|atom|api)$ ./index.php?mid=$1&act=$2 [L] -RewriteRule ^([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)/(rss|atom|api)$ ./index.php?vid=$1&mid=$2&act=$3 [L] - -# trackback -RewriteRule ^([0-9]+)/(.+)/trackback$ ./index.php?document_srl=$1&key=$2&act=trackback [L] -RewriteRule ^([a-zA-Z0-9_]+)/([0-9]+)/(.+)/trackback$ ./index.php?mid=$1&document_srl=$2&key=$3&act=trackback [L] -RewriteRule ^([a-zA-Z0-9_]+)/([0-9]+)/(.+)/trackback$ ./index.php?vid=$1&document_srl=$2&key=$3&act=trackback [L] -RewriteRule ^([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)/([0-9]+)/(.+)/trackback$ ./index.php?vid=$1&mid=$2&document_srl=$3&key=$4&act=trackback [L] - -# document permanent link -RewriteRule ^([0-9]+)$ ./index.php?document_srl=$1 [L,QSA] - -# mid link -RewriteCond %{SCRIPT_FILENAME} !-d -RewriteRule ^([a-zA-Z0-9_]+)/?$ ./index.php?mid=$1 [L,QSA] -# mid + document link -RewriteRule ^([a-zA-Z0-9_]+)/([0-9]+)$ ./index.php?mid=$1&document_srl=$2 [L,QSA] - -# vid + mid link -RewriteCond %{SCRIPT_FILENAME} !-d -RewriteRule ^([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)/?$ ./index.php?vid=$1&mid=$2 [L,QSA] -# vid + mid + document link -RewriteRule ^([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)/([0-9]+)$ ./index.php?vid=$1&mid=$2&document_srl=$3 [L,QSA] - -# mid + entry title -RewriteRule ^([a-zA-Z0-9_]+)/entry/(.+)$ ./index.php?mid=$1&entry=$2 [L,QSA] -# vid + mid + entry title -RewriteRule ^([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)/entry/(.+)$ ./index.php?vid=$1&mid=$2&entry=$3 [L,QSA] - -#shop / vid / [category|product] / identifier +# router RewriteCond %{SCRIPT_FILENAME} !-f -RewriteRule ^([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)/([a-zA-Z0-9_\.-]+)$ ./index.php?act=route&vid=$1&type=$2&identifier=$3 [L,QSA] +RewriteCond %{SCRIPT_FILENAME} !-d +RewriteRule ^(.*)$ ./index.php [L] diff --git a/README.md b/README.md index 2d9cf86ba..977e48730 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ XpressEngine(XE)은 PHP로 작성한 설치형 CMS(Content Management System)입 @akasima @bnu @jhyeon1010 @khongchi @ngleader ## Authors -adrian.vasile.constantin, aerofleet, @akasima, @andreimarin, araste, @bnu, @bongkeun, bradly1, buffkj, c2joy, @canto, cbrghost, @ccata17, @ChanMyeong, chinaskyking, chschy, clench, @cometdev, @devdho, @devjin, @dionisrom, @dorami, @dragan-dan, ducduydaovn, duvent, @Eundong, @florinutz, @flourscent, @flyskyko, @ForPeople, FruitsHake, guny, @haneul, hankm2004, @hansim, haojilin, heemin, @hyeon0142, ikko, @izuzero, johnsonshu, juanlee0, k10206, kagami, @khongchi, @lansi951, @largeden, liahona, lickawtl, @mAKEkr, mayoojin, mglclub, @misol, mmx900, @mog422, mooo, mosmartin, @nagoon97, @ngleader, nicetwo, ovclas, @qw5414, @Rayyin, risapapa, rokmcssu, royallin, rubyeye, ryin005, @samswnlee, sanghunjun, @sejin7940, @smaker, @solidh, sspa3141, @stellar12, supershop, @taggon, @ucorina, unryong, venister, wdlee91, welcomeju, @YJSoft, ysnglee2000, zero + ## Contribution Guide `CONTRIBUTING.md`파일을 참고하세요. diff --git a/classes/context/Context.class.php b/classes/context/Context.class.php index fefa62ecf..2c612b051 100644 --- a/classes/context/Context.class.php +++ b/classes/context/Context.class.php @@ -368,6 +368,12 @@ class Context // check if using rewrite module $this->allow_rewrite = ($this->db_info->use_rewrite == 'Y' ? TRUE : FALSE); + // If using rewrite module, initializes router + if($this->allow_rewrite) + { + Router::proc(); + } + // set locations for javascript use if($_SERVER['REQUEST_METHOD'] == 'GET') { @@ -1561,7 +1567,9 @@ class Context 'act.document_srl.key.mid.vid' => ($act == 'trackback') ? "$vid/$mid/$srl/$key/$act" : '' ); - $query = $target_map[$target]; + Router::setMap($target_map); + + $query = Router::makePrettyUrl($target); } if(!$query) diff --git a/classes/module/ModuleHandler.class.php b/classes/module/ModuleHandler.class.php index 75cf81bc1..99d7292f8 100644 --- a/classes/module/ModuleHandler.class.php +++ b/classes/module/ModuleHandler.class.php @@ -548,7 +548,6 @@ class ModuleHandler extends Handler } $xml_info = $oModuleModel->getModuleActionXml($forward->module); - $oMemberModel = getModel('member'); if($this->module == "admin" && $type == "view") { diff --git a/classes/object/Object.class.php b/classes/object/Object.class.php index aadf61e72..ed5a76bcf 100644 --- a/classes/object/Object.class.php +++ b/classes/object/Object.class.php @@ -165,7 +165,7 @@ class Object } /** - * Method to retrieve an object containing a key/value paris + * Method to retrieve an object containing a key/value pairs * * @return Object Returns an object containing key/value pairs */ diff --git a/classes/router/Router.class.php b/classes/router/Router.class.php new file mode 100644 index 000000000..94de130b3 --- /dev/null +++ b/classes/router/Router.class.php @@ -0,0 +1,205 @@ + array('module' => 'rss', 'act' => '$1'), + '([a-zA-Z0-9_]+)/(rss|atom|api)' => array('mid' => '$1', 'act' => '$2'), + '([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)/(rss|atom|api)' => array('vid' => '$1', 'mid' => '$2', 'act' => '$3'), + // trackback + '([0-9]+)/(.+)/trackback' => array('document_srl' => '$1', 'key' => '$2', 'act' => 'trackback'), + '([a-zA-Z0-9_]+)/([0-9]+)/(.+)/trackback' => array('mid' => '$1', 'document_srl' => '$2', 'key' => '$3', 'act' => 'trackback'), + '([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)/([0-9]+)/(.+)/trackback' => array('vid' => '$1', 'mid' => '$2', 'document_srl' => '$3' , 'key' => '$4', 'act' => 'trackback'), + // mid + '([a-zA-Z0-9_]+)/?' => array('mid' => '$1'), + // mid + document_srl + '([a-zA-Z0-9_]+)/([0-9]+)' => array('mid' => '$1', 'document_srl' => '$2'), + // vid + mid + '([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)/' => array('vid' => '$1', 'mid' => '$2'), + // vid + mid + document_srl + '([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)/([0-9]+)?' => array('vid' => '$1', 'mid' => '$2', 'document_srl' => '$3'), + // document_srl + '([0-9]+)' => array('document_srl' => '$1'), + // mid + entry title + '([a-zA-Z0-9_]+)/entry/(.+)' => array('mid' => '$1', 'entry' => '$2'), + // vid + mid + entry title + '([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)/entry/(.+)' => array('vid' => '$1', 'mid' => '$2', 'entry' => '$3'), + // shop / vid / [category|product] / identifier + '([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)/([a-zA-Z0-9_\.-]+)' => array('act' => 'route', 'vid' => '$1', 'type' => '$2', 'identifier'=> '$3') + ); + + /** + * Rewrite map + * @var array + */ + private static $rewrite_map = array(); + + /** + * @brief Applys routes. + * @see This function should be called only once + * @return void + */ + public static function proc() + { + $uri = $_SERVER['REQUEST_URI']; + + if (stripos($uri, $_SERVER['SCRIPT_NAME']) === 0) + { + $uri = substr($uri, strlen($_SERVER['SCRIPT_NAME'])); + } + elseif (strpos($uri, dirname($_SERVER['SCRIPT_NAME'])) === 0) + { + $uri = substr($uri, strlen(dirname($_SERVER['SCRIPT_NAME']))); + } + + if ($uri == '/' || empty($uri)) + { + return; + } + + $path = parse_url($uri, PHP_URL_PATH); + + // Do some final cleaning of the URI and return it + $path = str_replace(array('//', '../'), '/', trim($path, '/')); + + if(strlen($path) > 0) + { + self::$segments = explode('/', $path); + + // Remove the meanless segment + unset(self::$segments[0]); + } + + if(isset(self::$routes[$path])) + { + foreach(self::$routes[$path] as $key => $val) + { + $val = preg_replace('#^\$([0-9]+)$#e', '\$matches[$1]', $val); + + Context::set($key, $val, TRUE); + } + + return; + } + + // Apply routes + foreach(self::$routes as $regex => $query) + { + if(preg_match('#^' . $regex . '$#', $path, $matches)) + { + foreach($query as $key => $val) + { + $val = preg_replace('#^\$([0-9]+)$#e', '\$matches[$1]', $val); + + Context::set($key, $val, TRUE); + } + } + } + } + + /** + * @brief Add a rewrite map(s) + * @param array $map + * @return void + */ + public static function setMap($map) + { + self::$rewrite_map = array_merge(self::$rewrite_map, $map); + } + + /** + * @brief Add a route + * @param string $target + * @param array $query + * @return void + */ + public static function add($target, $query) + { + self::$routes[$target] = $query; + } + + /** + * @brief Add multiple routes + * @param array $routes + * @return void + */ + public function adds($routes) + { + self::$routes = array_merge(self::$routes, $routes); + } + + /** + * @brief Get segment from request uri + * @param int $index + * @return string + */ + public static function getSegment($index) + { + return self::$segments[$index]; + } + + + /** + * @brief Get segment from request uri + * @param int $index + * @return string + */ + public static function getSegments() + { + return self::$segments; + } + + /** + * @brief Get route info + * @param string $regex + * @return array + */ + public static function getRoute($regex) + { + return self::$routes[$regex]; + } + + /** + * @brief Get routes list + * @return array + */ + public static function getRoutes() + { + return self::$routes; + } + + /** + * @brief Get routes list + * @param string $regex + * @return boolean + */ + public static function isExistsRoute($regex) + { + return isset(self::$routes[$regex]); + } + + /** + * @brief Makes shortten url + * @param string $regex + * @return string + */ + public static function makePrettyUrl($regex) + { + return self::$rewrite_map[$regex]; + } +} \ No newline at end of file diff --git a/classes/template/TemplateHandler.class.php b/classes/template/TemplateHandler.class.php index 3a9d72b66..7c0b53d71 100644 --- a/classes/template/TemplateHandler.class.php +++ b/classes/template/TemplateHandler.class.php @@ -365,12 +365,34 @@ class TemplateHandler ob_start(); if(substr($buff, 0, 7) == 'file://') { - include(substr($buff, 7)); + if(__DEBUG__) + { + //load cache file from disk + $eval_str = FileHandler::readFile(substr($buff, 7)); + $eval_str_buffed = "?>" . $eval_str; + @eval($eval_str_buffed); + $error_info = error_get_last(); + //parse error + if ($error_info['type'] == 4) + { + throw new Exception("Error Parsing Template - {$error_info['message']} in template file {$this->file}"); + } + } + else + { + include(substr($buff, 7)); + } } else { $eval_str = "?>" . $buff; - eval($eval_str); + @eval($eval_str); + $error_info = error_get_last(); + //parse error + if ($error_info['type'] == 4) + { + throw new Exception("Error Parsing Template - {$error_info['message']} in template file {$this->file}"); + } } return ob_get_clean(); diff --git a/classes/xml/xmlquery/argument/Argument.class.php b/classes/xml/xmlquery/argument/Argument.class.php index 33eebc324..ffc275495 100644 --- a/classes/xml/xmlquery/argument/Argument.class.php +++ b/classes/xml/xmlquery/argument/Argument.class.php @@ -1,398 +1,396 @@ - */ - -/** - * Argument class - * @author NAVER (developers@xpressengine.com) - * @package /classes/xml/xmlquery/argument - * @version 0.1 - */ -class Argument -{ - - /** - * argument value - * @var mixed - */ - var $value; - - /** - * argument name - * @var string - */ - var $name; - - /** - * argument type - * @var string - */ - var $type; - - /** - * result of argument type check - * @var bool - */ - var $isValid; - - /** - * error message - * @var Object - */ - var $errorMessage; - - /** - * column operation - */ - var $column_operation; - - /** - * Check if arg value is user submnitted or default - * @var mixed - */ - var $uses_default_value; - - /** - * Caches escaped and toString value so that the parsing won't happen multiple times - * @var mixed - */ - var $_value; // - - /** - * constructor - * @param string $name - * @param mixed $value - * @return void - */ - - function Argument($name, $value) - { - $this->value = $value; - $this->name = $name; - $this->isValid = TRUE; - } - - function getType() - { - if(isset($this->type)) - { - return $this->type; - } - if(is_string($this->value)) - { - return 'column_name'; - } - - return 'number'; - } - - function setColumnType($value) - { - $this->type = $value; - } - - function setColumnOperation($operation) - { - $this->column_operation = $operation; - } - - function getName() - { - return $this->name; - } - - function getValue() - { - if(!isset($this->_value)) - { - $value = $this->getEscapedValue(); - $this->_value = $this->toString($value); - } - return $this->_value; - } - - function getPureValue() - { - return $this->value; - } - - function getColumnOperation() - { - return $this->column_operation; - } - - function getEscapedValue() - { - return $this->escapeValue($this->value); - } - - function getUnescapedValue() - { - if($this->value === 'null') - { - return null; - } - return $this->value; - } - - /** - * mixed value to string - * @param mixed $value - * @return string - */ - function toString($value) - { - if(is_array($value)) - { - if(count($value) === 0) - { - return ''; - } - if(count($value) === 1 && $value[0] === '') - { - return ''; - } - return '(' . implode(',', $value) . ')'; - } - return $value; - } - - /** - * escape value - * @param mixed $value - * @return mixed - */ - function escapeValue($value) - { - $column_type = $this->getType(); - if($column_type == 'column_name') - { - $dbParser = DB::getParser(); - return $dbParser->parseExpression($value); - } - if(!isset($value)) - { - return null; - } - - $columnTypeList = array('date' => 1, 'varchar' => 1, 'char' => 1, 'text' => 1, 'bigtext' => 1); - if(isset($columnTypeList[$column_type])) - { - if(!is_array($value)) - { - $value = $this->_escapeStringValue($value); - } - else - { - $total = count($value); - for($i = 0; $i < $total; $i++) - { - $value[$i] = $this->_escapeStringValue($value[$i]); - } - //$value[$i] = '\''.$value[$i].'\''; - } - } - if($this->uses_default_value) - { - return $value; - } - if($column_type == 'number') - { - if(is_array($value)) - { - foreach($value AS $key => $val) - { - if(isset($val) && $val !== '') - { - $value[$key] = (int) $val; - } - } - } - else - { - $value = (int) $value; - } - } - - return $value; - } - - /** - * escape string value - * @param string $value - * @return string - */ - function _escapeStringValue($value) - { - // Remove non-utf8 chars. - $regex = '@((?:[\x00-\x7F]|[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}){1,100})|([\xF0-\xF7][\x80-\xBF]{3})|([\x80-\xBF])|([\xC0-\xFF])@x'; - - $value = preg_replace_callback($regex, array($this, 'utf8Replacer'), $value); - $db = DB::getInstance(); - $value = $db->addQuotes($value); - return '\'' . $value . '\''; - } - - function utf8Replacer($captures) - { - if(strlen($captures[1])) - { - // Valid byte sequence. Return unmodified. - return $captures[1]; - } - else if(strlen($captures[2])) - { - // Remove user defined area - if("\xF3\xB0\x80\x80" <= $captures[2]) - { - return; - } - - return $captures[2]; - } - else - { - return; - } - } - - function isValid() - { - return $this->isValid; - } - - function isColumnName() - { - $type = $this->getType(); - $value = $this->getUnescapedValue(); - if($type == 'column_name') - { - return TRUE; - } - if($type == 'number' && is_null($value)) - { - return FALSE; - } - if($type == 'number' && !is_numeric($value) && $this->uses_default_value) - { - return TRUE; - } - return FALSE; - } - - function getErrorMessage() - { - return $this->errorMessage; - } - - function ensureDefaultValue($default_value) - { - if($this->value === NULL || $this->value === '') - { - $this->value = $default_value; - $this->uses_default_value = TRUE; - } - } - - /** - * check filter by filter type - * @param string $filter_type - * @return void - */ - function checkFilter($filter_type) - { - if(isset($this->value) && $this->value != '') - { - global $lang; - $val = $this->value; - $key = $this->name; - switch($filter_type) - { - case 'email' : - case 'email_address' : - if(!preg_match('/^[\w-]+((?:\.|\+|\~)[\w-]+)*@[\w-]+(\.[\w-]+)+$/is', $val)) - { - $this->isValid = FALSE; - $this->errorMessage = new Object(-1, sprintf($lang->filter->invalid_email, $lang->{$key} ? $lang->{$key} : $key)); - } - break; - case 'homepage' : - if(!preg_match('/^(http|https)+(:\/\/)+[0-9a-z_-]+\.[^ ]+$/is', $val)) - { - $this->isValid = FALSE; - $this->errorMessage = new Object(-1, sprintf($lang->filter->invalid_homepage, $lang->{$key} ? $lang->{$key} : $key)); - } - break; - case 'userid' : - case 'user_id' : - if(!preg_match('/^[a-zA-Z]+([_0-9a-zA-Z]+)*$/is', $val)) - { - $this->isValid = FALSE; - $this->errorMessage = new Object(-1, sprintf($lang->filter->invalid_userid, $lang->{$key} ? $lang->{$key} : $key)); - } - break; - case 'number' : - case 'numbers' : - if(is_array($val)) - { - $val = join(',', $val); - } - if(!preg_match('/^(-?)[0-9]+(,\-?[0-9]+)*$/is', $val)) - { - $this->isValid = FALSE; - $this->errorMessage = new Object(-1, sprintf($lang->filter->invalid_number, $lang->{$key} ? $lang->{$key} : $key)); - } - break; - case 'alpha' : - if(!preg_match('/^[a-z]+$/is', $val)) - { - $this->isValid = FALSE; - $this->errorMessage = new Object(-1, sprintf($lang->filter->invalid_alpha, $lang->{$key} ? $lang->{$key} : $key)); - } - break; - case 'alpha_number' : - if(!preg_match('/^[0-9a-z]+$/is', $val)) - { - $this->isValid = FALSE; - $this->errorMessage = new Object(-1, sprintf($lang->filter->invalid_alpha_number, $lang->{$key} ? $lang->{$key} : $key)); - } - break; - } - } - } - - function checkMaxLength($length) - { - if($this->value && (strlen($this->value) > $length)) - { - global $lang; - $this->isValid = FALSE; - $key = $this->name; - $this->errorMessage = new Object(-1, sprintf($lang->filter->outofrange, $lang->{$key} ? $lang->{$key} : $key)); - } - } - - function checkMinLength($length) - { - if($this->value && (strlen($this->value) < $length)) - { - global $lang; - $this->isValid = FALSE; - $key = $this->name; - $this->errorMessage = new Object(-1, sprintf($lang->filter->outofrange, $lang->{$key} ? $lang->{$key} : $key)); - } - } - - function checkNotNull() - { - if(!isset($this->value)) - { - global $lang; - $this->isValid = FALSE; - $key = $this->name; - $this->errorMessage = new Object(-1, sprintf($lang->filter->isnull, $lang->{$key} ? $lang->{$key} : $key)); - } - } - -} -/* End of file Argument.class.php */ -/* Location: ./classes/xml/xmlquery/argument/Argument.class.php */ + */ + +/** + * Argument class + * @author NAVER (developers@xpressengine.com) + * @package /classes/xml/xmlquery/argument + * @version 0.1 + */ +class Argument +{ + + /** + * argument value + * @var mixed + */ + var $value; + + /** + * argument name + * @var string + */ + var $name; + + /** + * argument type + * @var string + */ + var $type; + + /** + * result of argument type check + * @var bool + */ + var $isValid; + + /** + * error message + * @var Object + */ + var $errorMessage; + + /** + * column operation + */ + var $column_operation; + + /** + * Check if arg value is user submnitted or default + * @var mixed + */ + var $uses_default_value; + + /** + * Caches escaped and toString value so that the parsing won't happen multiple times + * @var mixed + */ + var $_value; // + + /** + * constructor + * @param string $name + * @param mixed $value + * @return void + */ + + function Argument($name, $value) + { + $this->value = $value; + $this->name = $name; + $this->isValid = TRUE; + } + + function getType() + { + if(isset($this->type)) + { + return $this->type; + } + if(is_string($this->value)) + { + return 'column_name'; + } + + return 'number'; + } + + function setColumnType($value) + { + $this->type = $value; + } + + function setColumnOperation($operation) + { + $this->column_operation = $operation; + } + + function getName() + { + return $this->name; + } + + function getValue() + { + if(!isset($this->_value)) + { + $value = $this->getEscapedValue(); + $this->_value = $this->toString($value); + } + return $this->_value; + } + + function getPureValue() + { + return $this->value; + } + + function getColumnOperation() + { + return $this->column_operation; + } + + function getEscapedValue() + { + return $this->escapeValue($this->value); + } + + function getUnescapedValue() + { + if($this->value === 'null') + { + return null; + } + return $this->value; + } + + /** + * mixed value to string + * @param mixed $value + * @return string + */ + function toString($value) + { + if(is_array($value)) + { + if(count($value) === 0) + { + return ''; + } + if(count($value) === 1 && $value[0] === '') + { + return ''; + } + return '(' . implode(',', $value) . ')'; + } + return $value; + } + + /** + * escape value + * @param mixed $value + * @return mixed + */ + function escapeValue($value) + { + $column_type = $this->getType(); + if($column_type == 'column_name') + { + $dbParser = DB::getParser(); + return $dbParser->parseExpression($value); + } + if(!isset($value)) + { + return null; + } + + $columnTypeList = array('date' => 1, 'varchar' => 1, 'char' => 1, 'text' => 1, 'bigtext' => 1); + if(isset($columnTypeList[$column_type])) + { + if(!is_array($value)) + { + $value = $this->_escapeStringValue($value); + } + else + { + foreach($value as $key=>$val) + { + $value[$key] = $this->_escapeStringValue($val); + } + } + } + if($this->uses_default_value) + { + return $value; + } + if($column_type == 'number') + { + if(is_array($value)) + { + foreach($value AS $key => $val) + { + if(isset($val) && $val !== '') + { + $value[$key] = (int) $val; + } + } + } + else + { + $value = (int) $value; + } + } + + return $value; + } + + /** + * escape string value + * @param string $value + * @return string + */ + function _escapeStringValue($value) + { + // Remove non-utf8 chars. + $regex = '@((?:[\x00-\x7F]|[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}){1,100})|([\xF0-\xF7][\x80-\xBF]{3})|([\x80-\xBF])|([\xC0-\xFF])@x'; + + $value = preg_replace_callback($regex, array($this, 'utf8Replacer'), $value); + $db = DB::getInstance(); + $value = $db->addQuotes($value); + return '\'' . $value . '\''; + } + + function utf8Replacer($captures) + { + if(strlen($captures[1])) + { + // Valid byte sequence. Return unmodified. + return $captures[1]; + } + else if(strlen($captures[2])) + { + // Remove user defined area + if("\xF3\xB0\x80\x80" <= $captures[2]) + { + return; + } + + return $captures[2]; + } + else + { + return; + } + } + + function isValid() + { + return $this->isValid; + } + + function isColumnName() + { + $type = $this->getType(); + $value = $this->getUnescapedValue(); + if($type == 'column_name') + { + return TRUE; + } + if($type == 'number' && is_null($value)) + { + return FALSE; + } + if($type == 'number' && !is_numeric($value) && $this->uses_default_value) + { + return TRUE; + } + return FALSE; + } + + function getErrorMessage() + { + return $this->errorMessage; + } + + function ensureDefaultValue($default_value) + { + if($this->value === NULL || $this->value === '') + { + $this->value = $default_value; + $this->uses_default_value = TRUE; + } + } + + /** + * check filter by filter type + * @param string $filter_type + * @return void + */ + function checkFilter($filter_type) + { + if(isset($this->value) && $this->value != '') + { + global $lang; + $val = $this->value; + $key = $this->name; + switch($filter_type) + { + case 'email' : + case 'email_address' : + if(!preg_match('/^[\w-]+((?:\.|\+|\~)[\w-]+)*@[\w-]+(\.[\w-]+)+$/is', $val)) + { + $this->isValid = FALSE; + $this->errorMessage = new Object(-1, sprintf($lang->filter->invalid_email, $lang->{$key} ? $lang->{$key} : $key)); + } + break; + case 'homepage' : + if(!preg_match('/^(http|https)+(:\/\/)+[0-9a-z_-]+\.[^ ]+$/is', $val)) + { + $this->isValid = FALSE; + $this->errorMessage = new Object(-1, sprintf($lang->filter->invalid_homepage, $lang->{$key} ? $lang->{$key} : $key)); + } + break; + case 'userid' : + case 'user_id' : + if(!preg_match('/^[a-zA-Z]+([_0-9a-zA-Z]+)*$/is', $val)) + { + $this->isValid = FALSE; + $this->errorMessage = new Object(-1, sprintf($lang->filter->invalid_userid, $lang->{$key} ? $lang->{$key} : $key)); + } + break; + case 'number' : + case 'numbers' : + if(is_array($val)) + { + $val = join(',', $val); + } + if(!preg_match('/^(-?)[0-9]+(,\-?[0-9]+)*$/is', $val)) + { + $this->isValid = FALSE; + $this->errorMessage = new Object(-1, sprintf($lang->filter->invalid_number, $lang->{$key} ? $lang->{$key} : $key)); + } + break; + case 'alpha' : + if(!preg_match('/^[a-z]+$/is', $val)) + { + $this->isValid = FALSE; + $this->errorMessage = new Object(-1, sprintf($lang->filter->invalid_alpha, $lang->{$key} ? $lang->{$key} : $key)); + } + break; + case 'alpha_number' : + if(!preg_match('/^[0-9a-z]+$/is', $val)) + { + $this->isValid = FALSE; + $this->errorMessage = new Object(-1, sprintf($lang->filter->invalid_alpha_number, $lang->{$key} ? $lang->{$key} : $key)); + } + break; + } + } + } + + function checkMaxLength($length) + { + if($this->value && (strlen($this->value) > $length)) + { + global $lang; + $this->isValid = FALSE; + $key = $this->name; + $this->errorMessage = new Object(-1, sprintf($lang->filter->outofrange, $lang->{$key} ? $lang->{$key} : $key)); + } + } + + function checkMinLength($length) + { + if($this->value && (strlen($this->value) < $length)) + { + global $lang; + $this->isValid = FALSE; + $key = $this->name; + $this->errorMessage = new Object(-1, sprintf($lang->filter->outofrange, $lang->{$key} ? $lang->{$key} : $key)); + } + } + + function checkNotNull() + { + if(!isset($this->value)) + { + global $lang; + $this->isValid = FALSE; + $key = $this->name; + $this->errorMessage = new Object(-1, sprintf($lang->filter->isnull, $lang->{$key} ? $lang->{$key} : $key)); + } + } + +} +/* End of file Argument.class.php */ +/* Location: ./classes/xml/xmlquery/argument/Argument.class.php */ diff --git a/common/css/xe.css b/common/css/xe.css index cdddb3605..44177eacc 100644 --- a/common/css/xe.css +++ b/common/css/xe.css @@ -300,7 +300,7 @@ button.btn { -moz-border-radius-topleft: 4px; border-top-left-radius: 4px; } -.btn-group>.btn: last-child { +.btn-group>.btn:last-child { -webkit-border-top-right-radius: 4px; -moz-border-radius-topright: 4px; border-top-right-radius: 4px; diff --git a/common/js/common.js b/common/js/common.js index 00fbe2bd2..b97a2284b 100644 --- a/common/js/common.js +++ b/common/js/common.js @@ -596,14 +596,25 @@ function doDocumentLoad(obj) { } /* 저장된 게시글의 선택 */ -function doDocumentSelect(document_srl) { +function doDocumentSelect(document_srl, module) { if(!opener || !opener.objForSavedDoc) { window.close(); return; } + if(module===undefined) { + module = 'document'; + } + // 게시글을 가져와서 등록하기 - opener.location.href = opener.current_url.setQuery('document_srl', document_srl).setQuery('act', 'dispBoardWrite'); + switch(module) { + case 'page' : + opener.location.href = opener.current_url.setQuery('document_srl', document_srl).setQuery('act', 'dispPageAdminContentModify'); + break; + default : + opener.location.href = opener.current_url.setQuery('document_srl', document_srl).setQuery('act', 'dispBoardWrite'); + break; + } window.close(); } diff --git a/common/js/xe.js b/common/js/xe.js index cd0e0aed2..7b6ad2a92 100644 --- a/common/js/xe.js +++ b/common/js/xe.js @@ -595,14 +595,25 @@ function doDocumentLoad(obj) { } /* 저장된 게시글의 선택 */ -function doDocumentSelect(document_srl) { +function doDocumentSelect(document_srl, module) { if(!opener || !opener.objForSavedDoc) { window.close(); return; } + if(module===undefined) { + module = 'document'; + } + // 게시글을 가져와서 등록하기 - opener.location.href = opener.current_url.setQuery('document_srl', document_srl).setQuery('act', 'dispBoardWrite'); + switch(module) { + case 'page' : + opener.location.href = opener.current_url.setQuery('document_srl', document_srl).setQuery('act', 'dispPageAdminContentModify'); + break; + default : + opener.location.href = opener.current_url.setQuery('document_srl', document_srl).setQuery('act', 'dispBoardWrite'); + break; + } window.close(); } diff --git a/common/js/xe.min.js b/common/js/xe.min.js index 39036c86a..c971b5c4d 100644 --- a/common/js/xe.min.js +++ b/common/js/xe.min.js @@ -3,4 +3,4 @@ * @file common.js + js_app.js + xml_handler.js + xml_js_filter.js * @brief XE Common JavaScript **/ -function xSleep(a){a/=1e3;for(var b=new Date,c=new Date;c.getTime()-b.getTime()-1&&!a.getQuery("vid")&&(a=a.setQuery("vid",xeVid));try{"_blank"!=b&&winopen_list[b]&&(winopen_list[b].close(),winopen_list[b]=null)}catch(d){}"undefined"==typeof b&&(b="_blank"),"undefined"==typeof c&&(c="");var e=window.open(a,b,c);e.focus(),"_blank"!=b&&(winopen_list[b]=e)}function popopen(a,b){"undefined"==typeof b&&(b="_blank"),"undefined"!=typeof xeVid&&a.indexOf(request_uri)>-1&&!a.getQuery("vid")&&(a=a.setQuery("vid",xeVid)),winopen(a,b,"width=800,height=600,scrollbars=yes,resizable=yes,toolbars=no")}function sendMailTo(a){location.href="mailto:"+a}function move_url(a,b){return a?("undefined"==typeof b&&(b="N"),b="N"==b?!1:!0,/^\./.test(a)&&(a=request_uri+a),b?winopen(a):location.href=a,!1):!1}function displayMultimedia(a,b,c,d){var e=_displayMultimedia(a,b,c,d);e&&document.writeln(e)}function _displayMultimedia(a,b,c,d){0===a.indexOf("files")&&(a=request_uri+a);var e={wmode:"transparent",allowScriptAccess:"never",quality:"high",flashvars:"",autostart:!1},f=jQuery.extend(e,d||{}),g=f.autostart&&"false"!=f.autostart?"true":"false";delete f.autostart;var h="",i="",j="";if(/\.(gif|jpg|jpeg|bmp|png)$/i.test(a))j='';else if(/\.flv$/i.test(a)||/\.mov$/i.test(a)||/\.moov$/i.test(a)||/\.m4v$/i.test(a))j='';else if(/\.swf/i.test(a)){h="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",i="undefined"!=typeof enforce_ssl&&enforce_ssl?"https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0":"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0",j='',j+='';for(var k in f)"undefined"!=f[k]&&""!==f[k]&&(j+='');j+=''}else(jQuery.browser.mozilla||jQuery.browser.opera)&&(g=f.autostart&&"false"!=f.autostart?"1":"0"),j='.popup");e=h.css({overflow:"scroll"}).offset(),a=h.width(10).height(1e4).get(0).scrollWidth+2*e.left,b=h.height(10).width(1e4).get(0).scrollHeight+2*e.top,800>a&&(a=800+2*e.left),c=g.width(),d=g.height(),a!=c&&window.resizeBy(a-c,0),b!=d&&window.resizeBy(0,b-d),h.width(a-2*e.left).css({overflow:"",height:""})}function doCallModuleAction(a,b,c){var d={target_srl:c,cur_mid:current_mid,mid:current_mid};exec_xml(a,b,d,completeCallModuleAction)}function completeCallModuleAction(a){"success"!=a.message&&alert(a.message),location.reload()}function completeMessage(a){alert(a.message),location.reload()}function doChangeLangType(a){if("string"==typeof a)setLangType(a);else{var b=a.options[a.selectedIndex].value;setLangType(b)}location.href=location.href.setQuery("l","")}function setLangType(a){var b=new Date;b.setTime(b.getTime()+6048e8),setCookie("lang_type",a,b,"/")}function doDocumentPreview(a){for(var b=a;"FORM"!=b.nodeName;)b=b.parentNode;if("FORM"==b.nodeName){var c=b.getAttribute("editor_sequence"),d=editorGetContent(c),e=(window.open("","previewDocument","toolbars=no,width=700px;height=800px,scrollbars=yes,resizable=yes"),jQuery("#previewDocument"));e.length?e=e[0]:(jQuery('
').appendTo(document.body),e=jQuery("#previewDocument")[0]),e&&(e.content.value=d,e.submit())}}function doDocumentSave(a){var b=a.form.getAttribute("editor_sequence"),c=editorRelKeys[b].content.value;if("undefined"!=typeof b&&b&&"undefined"!=typeof editorRelKeys&&"function"==typeof editorGetContent){var d=editorGetContent(b);editorRelKeys[b].content.value=d}var e={},f=["error","message","document_srl"],g=(a.form.elements,jQuery(a.form).serializeArray());return jQuery.each(g,function(a,b){var c=jQuery.trim(b.value);return c?(/\[\]$/.test(b.name)&&(b.name=b.name.replace(/\[\]$/,"")),void(e[b.name]?e[b.name]+="|@|"+c:e[b.name]=b.value)):!0}),exec_xml("document","procDocumentTempSave",e,completeDocumentSave,f,e,a.form),editorRelKeys[b].content.value=c,!1}function completeDocumentSave(a){jQuery("input[name=document_srl]").eq(0).val(a.document_srl),alert(a.message)}function doDocumentLoad(a){objForSavedDoc=a.form,popopen(request_uri.setQuery("module","document").setQuery("act","dispTempSavedList"))}function doDocumentSelect(a){return opener&&opener.objForSavedDoc?(opener.location.href=opener.current_url.setQuery("document_srl",a).setQuery("act","dispBoardWrite"),void window.close()):void window.close()}function viewSkinInfo(a,b){popopen("./?module=module&act=dispModuleSkinInfo&selected_module="+a+"&skin="+b,"SkinInfo")}function doAddDocumentCart(a){var b=a.value;addedDocument[addedDocument.length]=b,setTimeout(function(){callAddDocumentCart(addedDocument.length)},100)}function callAddDocumentCart(a){if(!(addedDocument.length<1||a!=addedDocument.length)){var b=[];b.srls=addedDocument.join(","),exec_xml("document","procDocumentAddCart",b,null),addedDocument=[]}}function transRGB2Hex(a){if(!a)return a;if(a.indexOf("#")>-1)return a.replace(/^#/,"");if(a.toLowerCase().indexOf("rgb")<0)return a;a=a.replace(/^rgb\(/i,"").replace(/\)$/,""),value_list=a.split(",");for(var b="",c=0;cf&&2>g){d.removeWhite(a);for(var j=a.firstChild;j;j=j.nextSibling)3==j.nodeType?b=d.escape(j.nodeValue):4==j.nodeType?b=d.escape(j.nodeValue):b[j.nodeName]?b[j.nodeName]instanceof Array?b[j.nodeName][b[j.nodeName].length]=d.toObj(j):b[j.nodeName]=[b[j.nodeName],d.toObj(j)]:b[j.nodeName]=d.toObj(j)}else a.attributes.length?b["#text"]=d.escape(d.innerXml(a)):b=d.escape(d.innerXml(a));else if(f)a.attributes.length?b["#text"]=d.escape(d.innerXml(a)):b=d.escape(d.innerXml(a));else if(g)if(g>1)b=d.escape(d.innerXml(a));else for(var k=a.firstChild;k;k=k.nextSibling)b=d.escape(k.nodeValue)}a.attributes.length||a.firstChild||(b=null)}else 9==a.nodeType?b=d.toObj(a.documentElement):alert("unhandled node type: "+a.nodeType);return b},toJson:function(a,b,c){var e=b?'"'+b+'"':"";if(a instanceof Array){for(var f=0,g=a.length;g>f;f++)a[f]=d.toJson(a[f],"",c+" ");e+=(b?":[":"[")+(a.length>1?"\n"+c+" "+a.join(",\n"+c+" ")+"\n"+c:a.join(""))+"]"}else if(null===a)e+=(b&&":")+"null";else if("object"==typeof a){var h=[];for(var i in a)h[h.length]=d.toJson(a[i],i,c+" ");e+=(b?":{":"{")+(h.length>1?"\n"+c+" "+h.join(",\n"+c+" ")+"\n"+c:h.join(""))+"}"}else e+="string"==typeof a?(b&&":")+'"'+a.toString()+'"':(b&&":")+a.toString();return e},innerXml:function(a){var b="";if("innerHTML"in a)b=a.innerHTML;else for(var c=function(a){var b="";if(1==a.nodeType){b+="<"+a.nodeName;for(var d=0;d"}else b+="/>"}else 3==a.nodeType?b+=a.nodeValue:4==a.nodeType&&(b+="");return b},d=a.firstChild;d;d=d.nextSibling)b+=c(d);return b},escape:function(a){return a.replace(/[\\]/g,"\\\\").replace(/[\"]/g,'\\"').replace(/[\n]/g,"\\n").replace(/[\r]/g,"\\r")},removeWhite:function(a){a.normalize();for(var b=a.firstChild;b;)if(3==b.nodeType)if(b.nodeValue.match(/[^ \f\n\r\t\v]/))b=b.nextSibling;else{var c=b.nextSibling;a.removeChild(b),b=c}else 1==b.nodeType?(d.removeWhite(b),b=b.nextSibling):b=b.nextSibling;return a}};9==a.nodeType&&(a=a.documentElement);var e,f=d.toObj(d.removeWhite(a));return e=d.toJson(f,a.nodeName,""),"{"+(b?e.replace(/\t/g,b):e.replace(/\t|\n/g,""))+"}"}function filterAlertMessage(a){var b=(a.error,a.message),c=a.act,d=a.redirect_url,e=location.href;"undefined"!=typeof b&&b&&"success"!=b&&alert(b),"undefined"!=typeof c&&c?e=current_url.setQuery("act",c):"undefined"!=typeof d&&d&&(e=d),e==location.href&&(e=e.replace(/#(.*)$/,"")),location.href=e}function procFilter(a,b){return b(a),!1}function legacy_filter(a,b,c,d,e,f,g,h){var i=xe.getApp("Validator")[0],j=jQuery,k=[];return i?(b.elements._filter||j(b).prepend(''),b.elements._filter.value=a,k[0]=a,k[1]=function(a){var i={},k=(a.elements,j(a).serializeArray());return j.each(k,function(a,b){var c=j.trim(b.value),d=b.name;return c&&d?(h[d]&&(d=h[d]),/\[\]$/.test(d)&&(d=d.replace(/\[\]$/,"")),void(i[d]?i[d]+="|@|"+c:i[d]=b.value)):!0}),g&&!confirm(g)?!1:void exec_xml(c,d,i,e,f,i,b)},i.cast("ADD_CALLBACK",k),i.cast("VALIDATE",[b,a]),!1):!1}jQuery&&jQuery.noConflict(),function(a){var b=navigator.userAgent.toLowerCase();a.os={Linux:/linux/.test(b),Unix:/x11/.test(b),Mac:/mac/.test(b),Windows:/win/.test(b)},a.os.name=a.os.Windows?"Windows":a.os.Linux?"Linux":a.os.Unix?"Unix":a.os.Mac?"Mac":"",window.XE={loaded_popup_menus:[],addedDocument:[],checkboxToggleAll:function(b){is_def(b)||(b="cart");var c,d={wrap:null,checked:"toggle",doClick:!1};switch(arguments.length){case 1:"string"==typeof arguments[0]?b=arguments[0]:(a.extend(d,arguments[0]||{}),b="cart");break;case 2:b=arguments[0],a.extend(d,arguments[1]||{})}d.doClick===!0&&(d.checked=null),"string"==typeof d.wrap&&(d.wrap="#"+d.wrap),c=d.wrap?a(d.wrap).find('input[name="'+b+'"]:checkbox'):a('input[name="'+b+'"]:checkbox'),"toggle"==d.checked?c.each(function(){a(this).attr("checked",a(this).attr("checked")?!1:!0)}):d.doClick===!0?c.click():c.attr("checked",d.checked)},displayPopupMenu:function(b,c,d){var e=(d.target_srl,d.menu_id),f=b.menus,g="";if(this.loaded_popup_menus[e])g=this.loaded_popup_menus[e];else{if(f){var h=f.item;if(("undefined"==typeof h.length||h.length<1)&&(h=new Array(h)),h.length)for(var i=0;i"+k+" "}}this.loaded_popup_menus[e]=g}if(g){var o=a("#popup_menu_area").html("
    "+g+"
"),p={top:d.page_y,left:d.page_x};o.outerHeight()+p.top>a(window).height()+a(window).scrollTop()&&(p.top=a(window).height()-o.outerHeight()+a(window).scrollTop()),o.outerWidth()+p.left>a(window).width()+a(window).scrollLeft()&&(p.left=a(window).width()-o.outerWidth()+a(window).scrollLeft()),o.css({top:p.top,left:p.left}).show().focus()}}}}(jQuery),jQuery(function(a){a.browser.msie&&a("select").each(function(a,b){for(var c=!1,d=[],e=0;e-1?d[a]:e;c&&(b.oldonchange=b.onchange,b.onchange=function(){this.options[this.selectedIndex].disabled?this.selectedIndex=d[a]:this.oldonchange&&this.oldonchange()},b.selectedIndex>=0&&b.options[b.selectedIndex].disabled&&b.onchange())});var b=a(".xe_content .fold_button");if(b.size()){var c=a("div.fold_container",b);a("button.more",b).click(function(){a(this).hide().next("button").show().parent().next(c).show()}),a("button.less",b).click(function(){a(this).hide().prev("button").show().parent().next(c).hide()})}jQuery('input[type="submit"],button[type="submit"]').click(function(a){var b=jQuery(a.currentTarget);setTimeout(function(){return function(){b.attr("disabled","disabled")}}(),0),setTimeout(function(){return function(){b.removeAttr("disabled")}}(),3e3)})}),function(){function a(a,b){return a.replace(/#.*$/,"")===b.replace(/#.*$/,"")}var b=Array.isArray||function(a){return"[object Array]"==Object.prototype.toString.call(a)};String.prototype.getQuery=function(b){var c=a(this,window.location.href)?current_url:this,d=c.indexOf("?");if(-1==d)return null;var e=c.substr(d+1,this.length),f={};e.replace(/([^=]+)=([^&]*)(&|$)/g,function(){f[arguments[1]]=arguments[2]});var g=f[b];return"undefined"==typeof g&&(g=""),g},String.prototype.setQuery=function(c,d){var e,f,g,h,i=a(this,window.location.href)?current_url:this,j=i.indexOf("?"),k=i.replace(/#$/,"");if("undefined"==typeof d&&(d=""),-1!=j){var l=k.substr(j+1,i.length),m={},n=[];k=i.substr(0,j),l.replace(/([^=]+)=([^&]*)(&|$)/g,function(a,b,c){m[b]=c}),m[c]=d;for(var o in m)m.hasOwnProperty(o)&&(g=String(m[o]).trim())&&n.push(o+"="+decodeURI(g));l=n.join("&"),k+=l?"?"+l:""}else String(d).trim()&&(k=k+"?"+c+"="+d);f=/^https:\/\/([^:\/]+)(:\d+|)/i,f.test(k)&&(h="http://"+RegExp.$1,window.http_port&&80!=http_port&&(h+=":"+http_port),k=k.replace(f,h));var p=!!window.enforce_ssl;if(!p&&b(window.ssl_actions)&&(e=k.getQuery("act")))for(var q=0,r=ssl_actions.length;r>q;q++)if(ssl_actions[q]===e){p=!0;break}return f=/http:\/\/([^:\/]+)(:\d+|)/i,p&&f.test(k)&&(h="https://"+RegExp.$1,window.https_port&&443!=https_port&&(h+=":"+https_port),k=k.replace(f,h)),k=k.replace(/\/(index\.php)?\?/,"/index.php?"),encodeURI(k)},String.prototype.trim=function(){return this.replace(/(^\s*)|(\s*$)/g,"")}}();var winopen_list=[],objForSavedDoc=null,addedDocument=[],Base64={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(a){var b,c,d,e,f,g,h,i="",j=0;for(a=Base64._utf8_encode(a);j>2,f=(3&b)<<4|c>>4,g=(15&c)<<2|d>>6,h=63&d,isNaN(c)?g=h=64:isNaN(d)&&(h=64),i=i+this._keyStr.charAt(e)+this._keyStr.charAt(f)+this._keyStr.charAt(g)+this._keyStr.charAt(h);return i},decode:function(a){var b,c,d,e,f,g,h,i="",j=0;for(a=a.replace(/[^A-Za-z0-9\+\/\=]/g,"");j>4,c=(15&f)<<4|g>>2,d=(3&g)<<6|h,i+=String.fromCharCode(b),64!=g&&(i+=String.fromCharCode(c)),64!=h&&(i+=String.fromCharCode(d));return i=Base64._utf8_decode(i)},_utf8_encode:function(a){a=a.replace(/\r\n/g,"\n");for(var b="",c=0;cd?b+=String.fromCharCode(d):d>127&&2048>d?(b+=String.fromCharCode(d>>6|192),b+=String.fromCharCode(63&d|128)):(b+=String.fromCharCode(d>>12|224),b+=String.fromCharCode(d>>6&63|128),b+=String.fromCharCode(63&d|128))}return b},_utf8_decode:function(a){for(var b="",c=0,d=0,e=0,f=0;cd?(b+=String.fromCharCode(d),c++):d>191&&224>d?(e=a.charCodeAt(c+1),b+=String.fromCharCode((31&d)<<6|63&e),c+=2):(e=a.charCodeAt(c+1),f=a.charCodeAt(c+2),b+=String.fromCharCode((15&d)<<12|(63&e)<<6|63&f),c+=3);return b}};"undefined"==typeof resizeImageContents&&(window.resizeImageContents=function(){}),"undefined"==typeof activateOptionDisabled&&(window.activateOptionDisabled=function(){}),objectExtend=jQuery.extend;var loaded_popup_menus=XE.loaded_popup_menus;jQuery(function(a){a(document).click(function(b){var c=a("#popup_menu_area");c.length||(c=a(' - +

{$title}

diff --git a/modules/install/tpl/form.mysql.html b/modules/install/tpl/form.mysql.html index c1a93a304..7946b98c9 100644 --- a/modules/install/tpl/form.mysql.html +++ b/modules/install/tpl/form.mysql.html @@ -7,7 +7,7 @@

{$XE_VALIDATOR_MESSAGE}

- +

{$title}

diff --git a/modules/install/tpl/form.mysql_innodb.html b/modules/install/tpl/form.mysql_innodb.html index c1a93a304..7946b98c9 100644 --- a/modules/install/tpl/form.mysql_innodb.html +++ b/modules/install/tpl/form.mysql_innodb.html @@ -7,7 +7,7 @@

{$XE_VALIDATOR_MESSAGE}

- +

{$title}

diff --git a/modules/install/tpl/form.mysqli.html b/modules/install/tpl/form.mysqli.html index 358e962f5..2a008984d 100644 --- a/modules/install/tpl/form.mysqli.html +++ b/modules/install/tpl/form.mysqli.html @@ -7,7 +7,7 @@

{$XE_VALIDATOR_MESSAGE}

- +

{$title}

diff --git a/modules/install/tpl/form.mysqli_innodb.html b/modules/install/tpl/form.mysqli_innodb.html index 358e962f5..2a008984d 100644 --- a/modules/install/tpl/form.mysqli_innodb.html +++ b/modules/install/tpl/form.mysqli_innodb.html @@ -7,7 +7,7 @@

{$XE_VALIDATOR_MESSAGE}

- +

{$title}

diff --git a/modules/member/member.admin.controller.php b/modules/member/member.admin.controller.php index d8e03ae49..2da5b3cd7 100644 --- a/modules/member/member.admin.controller.php +++ b/modules/member/member.admin.controller.php @@ -1109,6 +1109,11 @@ class memberAdminController extends member if(!$output->toBool()) return $output; } + if(!isset($args->list_order) || $args->list_order=='') + { + $args->list_order = $args->group_srl; + } + if(!$args->group_srl) $args->group_srl = getNextSequence(); $output = executeQuery('member.insertGroup', $args); $this->_deleteMemberGroupCache($args->site_srl); diff --git a/modules/member/member.admin.view.php b/modules/member/member.admin.view.php index ab12df6d9..eebe090dc 100644 --- a/modules/member/member.admin.view.php +++ b/modules/member/member.admin.view.php @@ -582,6 +582,7 @@ class memberAdminView extends member { $template = ''; $optionTag = array(); + $optionTag[] = sprintf('', $lang->cmd_select); if($extendForm->default_value) { foreach($extendForm->default_value as $v) diff --git a/modules/member/member.controller.php b/modules/member/member.controller.php index 989cdaeb2..24a9da7d2 100644 --- a/modules/member/member.controller.php +++ b/modules/member/member.controller.php @@ -230,8 +230,7 @@ class memberController extends member } // Check if duplicated $member_srl = $oMemberModel->getMemberSrlByNickName($value); - $member_srl_by_decode = $oMemberModel->getMemberSrlByNickName(utf8_decode($value)); - if(($member_srl && $logged_info->member_srl != $member_srl ) || ($member_srl_by_decode && $logged_info->member_srl != $member_srl_by_decode )) return new Object(0,'msg_exists_nick_name'); + if($member_srl && $logged_info->member_srl != $member_srl ) return new Object(0,'msg_exists_nick_name'); break; case 'email_address' : @@ -1970,8 +1969,7 @@ class memberController extends member return new Object(-1,'denied_nick_name'); } $member_srl = $oMemberModel->getMemberSrlByNickName($args->nick_name); - $member_srl_by_decode = $oMemberModel->getMemberSrlByNickName(utf8_decode($args->nick_name)); - if($member_srl || $member_srl_by_decode) return new Object(-1,'msg_exists_nick_name'); + if($member_srl) return new Object(-1,'msg_exists_nick_name'); $member_srl = $oMemberModel->getMemberSrlByEmailAddress($args->email_address); if($member_srl) return new Object(-1,'msg_exists_email_address'); @@ -2129,8 +2127,7 @@ class memberController extends member } $member_srl = $oMemberModel->getMemberSrlByNickName($args->nick_name); - $member_srl_by_decode = $oMemberModel->getMemberSrlByNickName(utf8_decode($args->nick_name)); - if(($member_srl || $member_srl_by_decode) && $orgMemberInfo->nick_name != $args->nick_name) return new Object(-1,'msg_exists_nick_name'); + if($member_srl && $orgMemberInfo->nick_name != $args->nick_name) return new Object(-1,'msg_exists_nick_name'); list($args->email_id, $args->email_host) = explode('@', $args->email_address); // Website, blog, checks the address diff --git a/modules/member/queries/insertGroup.xml b/modules/member/queries/insertGroup.xml index 40305009e..bdf00d49c 100644 --- a/modules/member/queries/insertGroup.xml +++ b/modules/member/queries/insertGroup.xml @@ -5,7 +5,7 @@ - + diff --git a/modules/message/skins/default/http_status_code.html b/modules/message/skins/default/http_status_code.html index e4719dea7..e119e9a86 100644 --- a/modules/message/skins/default/http_status_code.html +++ b/modules/message/skins/default/http_status_code.html @@ -1,16 +1,8 @@ - - - - - -01 - -