Skip to content

Commit

Permalink
Merge pull request #2 from xpressengine/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
sejin7940 committed May 11, 2014
2 parents 327165b + 83f146e commit 33fa988
Show file tree
Hide file tree
Showing 139 changed files with 1,714 additions and 642 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Expand Up @@ -2,5 +2,5 @@ config.user.inc.php
/files/
/build/
/node_modules/
.DS_Srore
.DS_Store
Thumbs.db
25 changes: 25 additions & 0 deletions CONTRIBUTING.md
@@ -0,0 +1,25 @@
# Contribution Guide

## Issue 작성
Issue 작성 시 참고해주세요.

* 작성하려는 이슈가 이미 있는지 검색 후 등록해주세요. 비슷한 이슈가 있다면 댓글로 추가 내용을 덧붙일 수 있습니다.
* 이슈에는 하나의 문제 또는 제안을 작성해주세요. 절대 하나의 이슈에 2개 이상의 내용을 적지마세요.
* 이슈는 가능한 상세하고 간결하게 작성해주세요
* 필요하다면 화면을 캡쳐하여 이미지를 업로드할 수 있습니다

## Pull request(PR)
* `master` 브랜치의 코드는 수정하지마세요
* PR은 `develop` 브랜치만 허용합니다.
* `develop` 브랜치를 부모로한 토픽 브랜치를 활용하면 편리합니다.


## Coding Guidelines
코드를 기여할 때 Coding conventions을 따라야합니다.

* 모든 text 파일의 charset은 BOM이 없는 UTF-8입니다
* newline은 UNIX type을 사용합니다. 일부 파일이 다른 type을 사용하더라도 절대 고치지 마세요!
* 들여쓰기는 1개의 탭으로 합니다
* class 선언과 function, if, foreach, for, while 등 중괄호의 `{}`는 다음 줄에 있어야 합니다
* 마찬가지로 선언 다음에는 공백을 두지 않습니다. ex) CORRECT `if(...)`, INCORRECT `if (...)`
* **Coding convention에 맞지 않는 코드를 발견 하더라도 목적과 관계 없는 코드는 절대 고치지 마세요**
25 changes: 21 additions & 4 deletions README.md
@@ -1,12 +1,29 @@
# XpressEngine
XpressEngine
============

[![Build Status](https://travis-ci.org/xpressengine/xe-core.svg?branch=master)](https://travis-ci.org/xpressengine/xe-core)
[![License](http://img.shields.io/badge/license-GNU%20LGPL-brightgreen.svg)](http://www.gnu.org/licenses/gpl.html)
[![Latest release](http://img.shields.io/github/release/xpressengine/xe-core.svg)](https://github.com/xpressengine/xe-core/releases)

XpressEngine(XE)은 PHP로 작성한 설치형 CMS(Content Management System)입니다.
오픈소스 라이선스로 누구나 사용 또는 개작할 수 있으며, 개방형 프로젝트로서 누구나 개발에 참여할 수 있습니다.

## Support
* Official sitie (Korean) : http://www.xpressengine.com/

## Maintainers
@akasima @bnu @jhyeon1010 @khongchi @ngleader

## Authors
adrian.vasile.constantin, aerofleet, @akasima, @andreimarin, araste, @bnu, bradly1, buffkj, c2joy, @canto, cbrghost, @ccata17, @ChanMyeong, chinaskyking, chschy, clench, @devjin, @dionisrom, @dorami, @dragan-dan, ducduydaovn, duvent, @Eundong, @florinutz, @flourscent, @flyskyko, @ForPeople, FruitsHake, guny, @haneul, hankm2004, haojilin, heemin, ikko, johnsonshu, juanlee0, k10206, kagami, @khongchi, @lansi951, @largeden, liahona, lickawtl, mayoojin, mglclub, @misol, mmx900, mooo, mosmartin, @nagoon97, @ngleader, nicetwo, ovclas, risapapa, rokmcssu, royallin, rubyeye, ryin005, sanghunjun, @sejin7940, @SMaker, sspa3141, @stellar12, supershop, @taggon, @ucorina, unryong, venister, wdlee91, welcomeju, @YJSoft, ysnglee2000, zero
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`파일을 참고하세요.

## License
Copyright (C) NAVER <http://www.navercorp.com>
Copyright 2014 NAVER Corp. <http://www.navercorp.com>

This library is free software; you can redistribute it and/or
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
Expand Down
9 changes: 8 additions & 1 deletion addons/blogapi/blogapi.addon.php
Expand Up @@ -30,6 +30,13 @@
// Read func file
require_once(_XE_PATH_ . 'addons/blogapi/blogapi.func.php');

// If HTTP_RAW_POST_DATA is NULL, Print error message
if(!$GLOBALS['HTTP_RAW_POST_DATA'])
{
$content = getXmlRpcFailure(1, 'Invalid Method Call');
printContent($content);
}

// xmlprc parsing
// Parse the requested xmlrpc
$xml = new SimpleXMLElement($GLOBALS['HTTP_RAW_POST_DATA']);
Expand Down Expand Up @@ -487,7 +494,7 @@
$post = new stdClass();
$post->categories = array();
$post->dateCreated = date("Ymd", $oDocument->getRegdateTime()) . 'T' . date("H:i:s", $oDocument->getRegdateTime());
$post->description = htmlspecialchars($oEditorController->transComponent($oDocument->getContent(false, false, true, false)), ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
$post->description = sprintf('<![CDATA[%s]]>',$oEditorController->transComponent($oDocument->getContent(false, false, true, false)));
$post->link = $post->permaLink = getFullUrl('', 'document_srl', $oDocument->document_srl);
$post->postid = $oDocument->document_srl;
$post->title = htmlspecialchars($oDocument->get('title'), ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
Expand Down
6 changes: 5 additions & 1 deletion addons/blogapi/blogapi.func.php
Expand Up @@ -31,7 +31,11 @@ function getXmlRpcResponse($params)
// Encoding
function _getEncodedVal($val, $is_sub_set = false)
{
if(is_int($val))
if(preg_match('/^\<\!\[CDATA\[/',$val))
{
$buff = sprintf("<value>%s</value>", $val);
}
elseif(is_int($val))
{
$buff = sprintf("<value><i4>%d</i4></value>", $val);
}
Expand Down
9 changes: 6 additions & 3 deletions addons/captcha/captcha.addon.php
Expand Up @@ -9,11 +9,14 @@
* @brief Captcha for a particular action
* English alphabets and voice verification added
* */
if(!class_exists('AddonCaptcha'))
if(!class_exists('AddonCaptcha', false))
{
// On the mobile mode, XE Core does not load jquery and xe.js as normal.
Context::loadFile(array('./common/js/jquery.min.js', 'head', NULL, -100000), true);
Context::loadFile(array('./common/js/xe.min.js', 'head', NULL, -100000), true);
if(Mobile::isFromMobilePhone())
{
Context::loadFile(array('./common/js/jquery.min.js', 'head', NULL, -100000), true);
Context::loadFile(array('./common/js/xe.min.js', 'head', NULL, -100000), true);
}

class AddonCaptcha
{
Expand Down
9 changes: 6 additions & 3 deletions addons/captcha_member/captcha_member.addon.php
Expand Up @@ -9,11 +9,14 @@
* @brief Captcha for a particular action
* English alphabets and voice verification added
* */
if(!class_exists('AddonMemberCaptcha'))
if(!class_exists('AddonMemberCaptcha', false))
{
// On the mobile mode, XE Core does not load jquery and xe.js as normal.
Context::loadFile(array('./common/js/jquery.min.js', 'head', NULL, -100000), true);
Context::loadFile(array('./common/js/xe.min.js', 'head', NULL, -100000), true);
if(Mobile::isFromMobilePhone())
{
Context::loadFile(array('./common/js/jquery.min.js', 'head', NULL, -100000), true);
Context::loadFile(array('./common/js/xe.min.js', 'head', NULL, -100000), true);
}

class AddonMemberCaptcha
{
Expand Down
8 changes: 4 additions & 4 deletions addons/oembed/jquery.oembed.js
Expand Up @@ -261,7 +261,7 @@
success: function (data) {
var oembedData = $.extend({}, data);
oembedData.code = embedProvider.templateData(data);
success(oembedData, externalUrl, container);
if(oembedData.code) success(oembedData, externalUrl, container);
},
error: settings.onError.call(container, externalUrl, embedProvider)
}, settings.ajaxOptions || {});
Expand Down Expand Up @@ -389,8 +389,8 @@

$.fn.oembed.getGenericCode = function (url, oembedData) {
var title = (oembedData.title !== null) ? oembedData.title : url,
code = '<a href="' + url + '">' + title + '</a>';
if(oembedData.html) code += "<div>" + oembedData.html + "</div>";
code = '';
if(oembedData.html) code += '<blockquote class="oembedall-blockquote"><strong>' + title + '</strong><br>' + jQuery(oembedData.html).text().substring(0,200) + '... <a href="'+url+'">more</a></blockquote>';
return code;
};

Expand Down Expand Up @@ -849,7 +849,7 @@
templateData: function (data) {
if(!data.parse) return false;
var text = data.parse['text']['*'].replace(/href="\/wiki/g, 'href="http://en.wikipedia.org/wiki');
return '<div id="content"><h3><a class="nav-link" href="http://en.wikipedia.org/wiki/' + data.parse['displaytitle'] + '">' + data.parse['displaytitle'] + '</a></h3>' + text + '</div>';
return '<div id="content"><blockquote class="oembedall-blockquote"><strong>' + data.parse['displaytitle'] + '</strong><br>' +jQuery(text).text().substring(0,200) + '...</blockquote></div>';
}
}),
new $.fn.oembed.OEmbedProvider("imdb", "rich", ["imdb.com/title/.+"], "http://www.imdbapi.com/?i=$1&callback=?", {
Expand Down
2 changes: 1 addition & 1 deletion addons/oembed/jquery.oembed.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion addons/resize_image/resize_image.addon.php
Expand Up @@ -9,7 +9,7 @@
* @author NAVER (developers@xpressengine.com)
* @brief Add-on to resize images in the body
*/
if($called_position == 'after_module_proc' && Context::getResponseMethod() == "HTML" || !isCrawler())
if($called_position == 'after_module_proc' && (Context::getResponseMethod() == "HTML" || !isCrawler()))
{
if(Mobile::isFromMobilePhone())
{
Expand Down
26 changes: 11 additions & 15 deletions classes/cache/CacheApc.class.php
Expand Up @@ -84,7 +84,7 @@ function isValid($key, $modified_time = 0)

if($modified_time > 0 && $modified_time > $obj[0])
{
$this->_delete($_key);
$this->delete($key);
return false;
}

Expand All @@ -110,24 +110,13 @@ function get($key, $modified_time = 0)

if($modified_time > 0 && $modified_time > $obj[0])
{
$this->_delete($_key);
$this->delete($key);
return false;
}

return $obj[1];
}

/**
* Delete variable from the cache(private)
*
* @param string $_key Used to store the value.
* @return void
*/
function _delete($_key)
{
$this->put($_key, null, 1);
}

/**
* Delete variable from the cache
*
Expand All @@ -136,7 +125,8 @@ function _delete($_key)
*/
function delete($key)
{
$this->_delete($key);
$_key = md5(_XE_PATH_ . $key);
return apc_delete($_key);
}

/**
Expand All @@ -149,7 +139,13 @@ function truncate()
return apc_clear_cache('user');
}


/**
* @DEPRECATED
*/
function _delete($key)
{
return $this->delete($key);
}
}

CacheApc::$isSupport = function_exists('apc_add');
Expand Down
13 changes: 13 additions & 0 deletions classes/context/Context.class.php
Expand Up @@ -205,6 +205,9 @@ function init()
$this->context->lang = &$GLOBALS['lang'];
$this->context->_COOKIE = $_COOKIE;

// 20140429 editor/image_link
$this->_checkGlobalVars();

$this->setRequestMethod('');

$this->_setXmlRpcArgument();
Expand Down Expand Up @@ -1115,6 +1118,16 @@ function setRequestMethod($type = '')
($self->request_method = $_SERVER['REQUEST_METHOD']);
}

/**
* handle global arguments
*
* @return void
*/
function _checkGlobalVars()
{
$this->_recursiveCheckVar($_SERVER['HTTP_HOST']);
}

/**
* handle request areguments for GET/POST
*
Expand Down
2 changes: 1 addition & 1 deletion classes/db/DB.class.php
Expand Up @@ -447,7 +447,7 @@ function actFinish()
$log['act'] = Context::get('act');
$log['time'] = date('Y-m-d H:i:s');

$bt = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);
$bt = debug_backtrace();
foreach($bt as $no => $call)
{
if($call['function'] == 'executeQuery' || $call['function'] == 'executeQueryArray')
Expand Down
10 changes: 5 additions & 5 deletions classes/db/DBMssql.class.php
Expand Up @@ -30,11 +30,11 @@ class DBMssql extends DB
var $column_type = array(
'bignumber' => 'bigint',
'number' => 'int',
'varchar' => 'varchar',
'char' => 'char',
'text' => 'text',
'bigtext' => 'text',
'date' => 'varchar(14)',
'varchar' => 'nvarchar',
'char' => 'nchar',
'text' => 'ntext',
'bigtext' => 'ntext',
'date' => 'nvarchar(14)',
'float' => 'float',
);

Expand Down
4 changes: 2 additions & 2 deletions classes/db/DBMysql.class.php
Expand Up @@ -85,9 +85,9 @@ function __connect($connection)
return;
}
// Error appears if the version is lower than 4.1
if(mysql_get_server_info($result) < "4.1")
if(version_compare(mysql_get_server_info($result), '4.1', '<'))
{
$this->setError(-1, "XE cannot be installed under the version of mysql 4.1. Current mysql version is " . mysql_get_server_info());
$this->setError(-1, 'XE cannot be installed under the version of mysql 4.1. Current mysql version is ' . mysql_get_server_info());
return;
}
// select db
Expand Down
5 changes: 3 additions & 2 deletions classes/display/DisplayHandler.class.php
Expand Up @@ -164,12 +164,13 @@ function _debugOutput()
array(
'Request / Response info >>> ' . $_SERVER['REQUEST_METHOD'] . ' / ' . Context::getResponseMethod(),
array(
array('Request URI', 'Request method', 'Response method', 'Response contents size'),
array('Request URI', 'Request method', 'Response method', 'Response contents size', 'Memory peak usage'),
array(
sprintf("%s:%s%s%s%s", $_SERVER['SERVER_NAME'], $_SERVER['SERVER_PORT'], $_SERVER['PHP_SELF'], $_SERVER['QUERY_STRING'] ? '?' : '', $_SERVER['QUERY_STRING']),
$_SERVER['REQUEST_METHOD'],
Context::getResponseMethod(),
$this->content_size . ' byte'
$this->content_size . ' byte',
FileHandler::filesize(memory_get_peak_usage())
)
)
),
Expand Down
10 changes: 5 additions & 5 deletions classes/display/HTMLDisplayHandler.php
Expand Up @@ -63,7 +63,7 @@ function toDoc(&$oModule)
// add .x div for adminitration pages
if(Context::getResponseMethod() == 'HTML')
{
if(Context::get('module') != 'admin' && strpos(Context::get('act'), 'Admin') > 0)
if(Context::get('module') != 'admin' && strpos(Context::get('act'), 'Admin') > 0 && Context::get('act') != 'dispPageAdminContentModify' && Context::get('act') != 'dispPageAdminMobileContentModify')
{
$output = '<div class="x">' . $output . '</div>';
}
Expand Down Expand Up @@ -174,7 +174,7 @@ function prepareToPrint(&$output)
$output = preg_replace_callback('!<meta(.*?)(?:\/|)>!is', array($this, '_moveMetaToHeader'), $output);

// change a meta fine(widget often put the tag like <!--Meta:path--> to the content because of caching)
$output = preg_replace_callback('/<!--(#)?Meta:([a-z0-9\_\/\.\@]+)-->/is', array($this, '_transMeta'), $output);
$output = preg_replace_callback('/<!--(#)?Meta:([a-z0-9\_\-\/\.\@]+)-->/is', array($this, '_transMeta'), $output);

// handles a relative path generated by using the rewrite module
if(Context::isAllowRewrite())
Expand Down Expand Up @@ -394,7 +394,7 @@ function _loadJSCSS()
$lang_type = Context::getLangType();

// add common JS/CSS files
if(__DEBUG__)
if(__DEBUG__ || !__XE_VERSION_STABLE__)
{
$oContext->loadFile(array('./common/js/jquery-1.x.js', 'head', 'lt IE 9', -111000), true);
$oContext->loadFile(array('./common/js/jquery.js', 'head', 'gte IE 9', -110000), true);
Expand All @@ -417,7 +417,7 @@ function _loadJSCSS()
// for admin page, add admin css
if(Context::get('module') == 'admin' || strpos(Context::get('act'), 'Admin') > 0)
{
if(__DEBUG__)
if(__DEBUG__ || !__XE_VERSION_STABLE__)
{
$oContext->loadFile(array('./modules/admin/tpl/css/admin.css', '', '', 10), true);
$oContext->loadFile(array("./modules/admin/tpl/css/admin_{$lang_type}.css", '', '', 10), true);
Expand Down Expand Up @@ -449,7 +449,7 @@ private function _loadMobileJSCSS()
$lang_type = Context::getLangType();

// add common JS/CSS files
if(__DEBUG__)
if(__DEBUG__ || !__XE_VERSION_STABLE__)
{
$oContext->loadFile(array('./common/css/mobile.css', '', '', -1000000), true);
}
Expand Down

0 comments on commit 33fa988

Please sign in to comment.