Skip to content

Commit

Permalink
refs #514 : merge with 2.0 tree.
Browse files Browse the repository at this point in the history
  • Loading branch information
inureyes committed Jun 12, 2011
2 parents c83bc62 + 80698db commit 1127e67
Show file tree
Hide file tree
Showing 280 changed files with 42,004 additions and 378 deletions.
29 changes: 29 additions & 0 deletions documents/changelog_ko.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,35 @@
* 이 문서는 변경사항을 모두 포함하고 있지 않을 수 있습니다. 자세한 변경사항 열람을 위해서는 텍스트큐브 개발 사이트 (http://dev.textcube.org) 의 해당 버전의 로드맵과 티켓들을 확인해 주시기 바랍니다.
* 버그 로그는 일반적으로 이전 버전에서 발생했으나 해결된 부분을 포함하며, 이번 버전을 만드는 과정에서 발생하는 버그는 기록하지 않습니다.

== v1.8.7 개발 관련 노트 ==
=== 추가된 점 ===
* 일반 : SQLite3를 데이터 저장 backend로 지원 (알파) (#1575)

=== 변경된 점 ===
* 관리패널 : canon 스킨의 주/부메뉴 글꼴 크기를 줄임 (#1519)

=== 버그 수정 ===
* 모바일 : 일부 웹서버의 URL 인코딩 셋팅이 안드로이드 브라우저 접속시 공개 글을 보호글로 보이도록 하는 문제 수정 (#1581)
* 일반 : 대량의 스팸이 휴지통에 있는 경우 데이터 교정이 실행되다 멈추는 문제 수정 (#1581)
* 일반 : 리샘플링 설정이 변경되지 않는 문제 수정 (#1581)
* 관리패널 : 전체 관리 모드에서 새 블로그 추가가 되지 않는 문제 수정 (#1582)

== v1.8.6 개발 관련 노트 ==
=== 추가된 점 ===
* 스킨 : 댓글 다 보여주기 / 페이징 여부에 상관없이 댓글 정렬 순서를 스킨/스킨 상세 설정 에서 조정할 수 있도록 함.(#1570)
* 블로그 : 안드로이드에서 iPhone/iPod Touch와 동일한 UI 지원 (#1576)

=== 변경된 점 ===
* 일반 : jQuery 라이브러리의 버전 업데이트 (#1560)
* 일반 : 로그인 시 블로그로 되돌아가기 링크 추가 (#1567)

=== 버그 수정 ===
* 일반 : PHP 5.3 이상에서 DirectoryIterator가 더이상 순차적 파일 이름 정렬을 보장하지 않아 발생할 수 있는 라이브러리 로드 문제 수정 (#1564)
* 리더 : 플래시를 통하여 악의적 공격이 가능할 수 있는 문제 수정 (#1107)
* OpenID : 방문자 계정을 생성하여 XSS 삽입 방식의 공격이 가능할 수 있는 문제 수정 (#1558)
* Setup : 설치시 MySQL쿼리의 문법 오류 수정 (#1577)
* 스킨 : 스킨 편집시 마지막으로 편집한 탭의 내용이 저장되지 않는 문제 수정 (#1580)

== v1.8.5 개발 관련 노트 ==
=== 변경된 점 ===
* TTXML : ttxml 출력시 memory-hog 오류 방지를 위하여 버퍼 기반의 출력방식으로 변경 (#1522)
Expand Down
7 changes: 6 additions & 1 deletion framework/boot/20-Autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,12 @@ class Autoload {
static function load($className) {
$pos =strrpos($className,'_');
if($pos!==false) {
require_once ROOT.'/framework/'.str_replace('_','/',strtolower(substr($className,0,$pos))).'/'.substr($className,$pos+1).'.php';
$naf2frameworkPath = ROOT.'/framework/'.str_replace('_','/',strtolower(substr($className,0,$pos))).'/'.substr($className,$pos+1).'.php';
if (file_exists($naf2frameworkPath)) {
require_once $naf2frameworkPath;
} else {
// TODO : Error handler here.
}
} else {
// Original structure (NAF2)
if (file_exists(ROOT.'/framework/alias/'.$className.'.php')) {
Expand Down
2 changes: 1 addition & 1 deletion framework/data/DBModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ public function replace($option = null) {
$pairs = $attributes;
foreach($pairs as $key => $value) if (is_null($value)) $pairs[$key] = 'NULL';
$attributeFields = $this->_capsulateFields(array_keys($attributes));
if (in_array(POD::dbms(), array('MySQL','MySQLi'))) { // Those supports 'REPLACE'
if (in_array(POD::dbms(), array('MySQL','MySQLi','SQLite3'))) { // Those supports 'REPLACE'
$this->_query = 'REPLACE INTO ' . $this->table . ' (' . implode(',', $attributeFields) . ') VALUES(' . implode(',', $pairs) . ')';
if($option == 'count') return POD::queryCount($this->_query);
if (POD::query($this->_query)) {
Expand Down
24 changes: 14 additions & 10 deletions framework/legacy/Textcube.Control.Session.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,9 @@ public static function getName() {
public static function read($id) {
if(is_null(self::$context)) self::initialize();

if ($result = self::query('cell',"SELECT privilege FROM ".self::$context->getProperty('database.prefix')."Sessions
WHERE id = '$id' AND address = '{$_SERVER['REMOTE_ADDR']}' AND updated >= (UNIX_TIMESTAMP() - ".self::$context->getProperty('service.timeout').")")) {
if ($result = self::query('cell',"SELECT privilege FROM ".self::$context->getProperty('database.prefix')."Sessions ".
/// WHERE id = '$id' AND address = '{$_SERVER['REMOTE_ADDR']}' AND updated >= (".(Timestamp::getUNIXtime() - self::$context->getProperty('service.timeout')).")")) {
"WHERE id = '$id' AND updated >= (".(Timestamp::getUNIXtime() - self::$context->getProperty('service.timeout')).")")) {
return $result;
}
return '';
Expand Down Expand Up @@ -81,8 +82,9 @@ public static function write($id, $data) {

public static function destroy($id, $setCookie = false) {
if(is_null(self::$context)) self::initialize();
self::query('query',"DELETE FROM ".self::$context->getProperty('database.prefix')."Sessions
WHERE id = '$id' AND address = '{$_SERVER['REMOTE_ADDR']}'");
self::query('query',"DELETE FROM ".self::$context->getProperty('database.prefix')."Sessions ".
// WHERE id = '$id' AND address = '{$_SERVER['REMOTE_ADDR']}'");
"WHERE id = '$id'");
self::gc();
}

Expand Down Expand Up @@ -127,7 +129,7 @@ private static function newAnonymousSession() {
if (($id = self::getAnonymousSession()) !== false)
return $id;
$id = dechex(rand(0x10000000, 0x7FFFFFFF)) . dechex(rand(0x10000000, 0x7FFFFFFF)) . dechex(rand(0x10000000, 0x7FFFFFFF)) . dechex(rand(0x10000000, 0x7FFFFFFF));
$result = self::query('count',"INSERT INTO ".self::$context->getProperty('database.prefix')."Sessions (id, address, server, request, referer, created, updated, expires) VALUES('$id', '{$_SERVER['REMOTE_ADDR']}', '', '', '', UNIX_TIMESTAMP(), UNIX_TIMESTAMP() - $meet_again_baby,".($current+self::$context->getProperty('service.timeout')).")");
$result = self::query('count',"INSERT INTO ".self::$context->getProperty('database.prefix')."Sessions (id, address, server, request, referer, created, updated, expires) VALUES('$id', '{$_SERVER['REMOTE_ADDR']}', '', '', '', ".Timestamp::getUNIXtime().", ".Timestamp::getUNIXtime()." - $meet_again_baby,".($current+self::$context->getProperty('service.timeout')).")");
if ($result > 0)
return $id;
}
Expand Down Expand Up @@ -167,8 +169,9 @@ public static function isGuestOpenIDSession($id) {
if(is_null(self::$context)) self::initialize();
$result = self::query('cell',"SELECT id
FROM ".self::$context->getProperty('database.prefix')."Sessions
WHERE id = '$id'
AND address = '{$_SERVER['REMOTE_ADDR']}' AND userid < 0");
WHERE id = '$id'".
// AND address = '{$_SERVER['REMOTE_ADDR']}' AND userid < 0");
" AND userid < 0");
if ($result)
return true;
return false;
Expand Down Expand Up @@ -207,8 +210,9 @@ public static function authorize($blogid, $userid, $expires = null) {
$_SESSION['userid'] = $userid;
$id = session_id();
if( self::isGuestOpenIDSession($id) ) {
$result = self::query('execute',"UPDATE ".self::$context->getProperty('database.prefix')."Sessions
SET userid = $userid WHERE id = '$id' AND address = '{$_SERVER['REMOTE_ADDR']}'");
$result = self::query('execute',"UPDATE ".self::$context->getProperty('database.prefix')."Sessions ".
// SET userid = $userid WHERE id = '$id' AND address = '{$_SERVER['REMOTE_ADDR']}'");
"SET userid = $userid WHERE id = '$id'");
if ($result) {
return true;
}
Expand Down Expand Up @@ -260,4 +264,4 @@ private static function DBQuery($mode='query',$sql) {
return null;
}
}
?>
?>
1 change: 1 addition & 0 deletions interface/common/blog/end.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,4 +136,5 @@
$view = revertTempTags(removeAllTags($view));
print $view;
$gCacheStorage->save();
POD::$db->close();
?>
2 changes: 1 addition & 1 deletion interface/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
if(isset($suri['id'])) {
$slogan = getSloganById($blogid, $suri['id']);
if(!empty($slogan)) {
header("Location: ".$context->getProperty('uri.blog')."/i/entry/".$slogan); exit;
header("Location: ".$context->getProperty('uri.blog')."/i/entry/".URL::encode($slogan)); exit;
}
} else {
header("Location: ".$context->getProperty('uri.blog')."/i"); exit;
Expand Down
7 changes: 3 additions & 4 deletions interface/owner/data/correct/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ function setProgress($progress, $text = null, $sub = null) {
setProgress($item++ / $items * 100, _t('태그와 태그 관계 정보를 다시 계산해서 저장합니다.'));
$post->correctTagsAll();

if ($result = POD::query("SELECT id, name, parent, homepage, comment, entry, isfiltered FROM {$database['prefix']}Comments WHERE blogid = $blogid")) {
if ($result = POD::query("SELECT id, name, parent, homepage, comment, entry, isfiltered FROM {$database['prefix']}Comments WHERE blogid = $blogid and isfiltered = 0")) {
while ($comment = POD::fetch($result)) {
setProgress($item++ / $items * 100, _t('댓글과 방명록 데이터를 교정하고 있습니다.'));
$correction = '';
Expand All @@ -120,11 +120,10 @@ function setProgress($progress, $text = null, $sub = null) {
$corrected++;
}
if (!is_null($comment['parent']) && ($comment['isfiltered'] == 0)) {
$r2 = POD::query("SELECT id FROM {$database['prefix']}Comments WHERE blogid = $blogid AND id = {$comment['parent']} AND isfiltered = 0");
if (POD::num_rows($r2) <= 0) {
$r2 = POD::queryCount("SELECT id FROM {$database['prefix']}Comments WHERE blogid = $blogid AND id = {$comment['parent']} AND isfiltered = 0");
if ($r2 <= 0) {
trashCommentInOwner($blogid, $comment['id']);
}
POD::free($r2);
}
}
POD::free($result);
Expand Down
1 change: 1 addition & 0 deletions interface/owner/entry/edit/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,7 @@ function EntryManager() {
return false;
}
PM.removeRequest(this);
editor.finalize();
var returnURI = "";
var oForm = document.forms[0];
var changedPermalink = trim(oForm.permalink.value);
Expand Down
2 changes: 1 addition & 1 deletion interface/owner/setting/entry/resample/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
if (isset($_POST['useResamplingAsDefault']) && ($_POST['useResamplingAsDefault'] == "yes")) {
Setting::setBlogSettingGlobal("resamplingDefault", "yes");
} else {
Setting::removeBlogSettingiGlobal("resamplingDefault");
Setting::removeBlogSettingGlobal("resamplingDefault");
}
CacheControl::flushEntry();

Expand Down
3 changes: 0 additions & 3 deletions interface/owner/skin/edit/download/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@
);

require ROOT . '/library/preprocessor.php';
if (false) {
fetchConfigVal();
}

if (!file_exists(ROOT . "/skin/customize/".getBlogId()."/".$_GET['file']))
exit;
Expand Down
64 changes: 42 additions & 22 deletions interface/owner/skin/edit/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,40 +49,58 @@ function setSkin(mode) {
if ((mode == 'skin' && skinHTMLSaved == false) || (mode == 'style' && skinStyleSaved == false)) {
if(mode == 'skin' && currentTag != 'all') {
skinData = skinCode;
currentCode = document.getElementById(mode).value;
var request = new HTTPRequest("POST", "<?php echo $context->getProperty('uri.blog');?>/owner/skin/edit/crop/");
request.onSuccess = function() {
skinData = this.getText("/response/skinCode");
saveSkinCode(mode,skinData,file);
}
request.onError = function() {
if (this.getText("/response/msg"))
alert(this.getText("/response/msg"));
else
alert('<?php echo _t('실패했습니다.');?>');
}
request.send('skinCode='+encodeURIComponent(skinCode)
+'&currentTag='+encodeURIComponent(currentTag)
+'&currentCode='+encodeURIComponent(currentCode)
+'&nextTag=all');
} else {
skinData = skin.value;
saveSkinCode(mode,skinData,file);
}

var request = new HTTPRequest("POST", "<?php echo $context->getProperty('uri.blog');?>/owner/skin/edit/skin/");
request.onSuccess = function() {
PM.showMessage("<?php echo _t('저장되었습니다');?>", "center", "bottom");

if (mode == 'skin') {
skinHTMLSaved = true;
if(document.getElementById('skin-download').innerHTML == '') {
document.getElementById('skin-download').innerHTML = '<a href="<?php echo $context->getProperty('uri.blog');?>/owner/skin/edit/download/?file=skin.html"><?php echo _t('내려받기');?></a>';
}
} else {
skinStyleSaved = true;
}
}
function saveSkinCode(mode,skinData,file) {
var request = new HTTPRequest("POST", "<?php echo $context->getProperty('uri.blog');?>/owner/skin/edit/skin/");
request.onSuccess = function() {
PM.showMessage("<?php echo _t('저장되었습니다');?>", "center", "bottom");

if (mode == 'skin') {
skinHTMLSaved = true;
if(document.getElementById('skin-download').innerHTML == '') {
document.getElementById('skin-download').innerHTML = '<a href="<?php echo $context->getProperty('uri.blog');?>/owner/skin/edit/download/?file=skin.html"><?php echo _t('내려받기');?></a>';
}
} else {
skinStyleSaved = true;
}
request.onError = function() {
if (this.getText("/response/msg"))
alert(this.getText("/response/msg"));
else
alert('<?php echo _t('실패했습니다.');?>');
}
request.send('mode='+mode+'&body='+encodeURIComponent(skinData)+'&file='+ file.value);
}
request.onError = function() {
if (this.getText("/response/msg"))
alert(this.getText("/response/msg"));
else
alert('<?php echo _t('실패했습니다.');?>');
}
request.send('mode='+mode+'&body='+encodeURIComponent(skinData)+'&file='+ file.value);
}

var currentTag = 'all';
var currentCode = '';

function changeTab(mode,tag) {
currentCode = document.getElementById(mode).value;
var request = new HTTPRequest("POST", "<?php echo $context->getProperty('uri.blog');?>/owner/skin/edit/crop/");
request.onSuccess = function() {
PM.showMessage("<?php echo _t('불러왔습니다.');?>", "center", "top");
PM.showMessage("<?php echo _t('불러왔습니다.');?>", "center", "bottom");
document.getElementById(mode).value = (this.getText("/response/code") ? this.getText("/response/code") : '');
skinCode = this.getText("/response/skinCode");
document.getElementById('skin-'+currentTag).className = '';
Expand Down Expand Up @@ -113,8 +131,10 @@ function undo(mode) {
}
return true;
}


<?php
if (count($styleFileList) > 0 && !empty($currentStyleFile) && file_exists(ROOT . "/skin/blog/{$skinSetting['skin']}/" . $currentStyleFile)) {
if (count($styleFileList) > 0 && !empty($currentStyleFile) && file_exists(ROOT . "/skin/blog/".$context->getProperty('skin.skin')."/" . $currentStyleFile)) {
?>
var currentStyleLiNumber = 0;
var documentIcons = new Array();
Expand Down
21 changes: 21 additions & 0 deletions library/model/blog.archive.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,22 @@ function getArchives($blogid, $option = 'yearmonth') {
}
}
break;
case 'SQLite3':
if($option == 'year') $format = '%Y';
else if ($option == 'month') $format = '%m';
else $format = '%Y%m';
$sql = "SELECT strftime('".$format."',e.published,'unixepoch') AS period, COUNT(*) AS count
FROM {$database['prefix']}Entries e
WHERE e.blogid = $blogid AND e.draft = 0 $visibility AND e.category >= 0
GROUP BY period
ORDER BY period
DESC LIMIT $archivesOnPage";
$result = POD::queryAllWithDBCache($sql, 'entry');
if ($result) {
foreach($result as $archive)
array_push($archives, $archive);
}
break;
case 'Cubrid':
if($option == 'year') $format = 'YYYY';
else if ($option == 'month') $format = 'MM';
Expand Down Expand Up @@ -97,6 +113,11 @@ function getCalendar($blogid, $period) {
TO_CHAR(to_timestamp('09:00:00 AM 01/01/1970')+e.published, 'YYYY') = '{$calendar['year']}' AND
TO_CHAR(to_timestamp('09:00:00 AM 01/01/1970')+e.published, 'MM') = '{$calendar['month']}'",'entry');
break;
case 'SQLite3':
$result = POD::queryAllWithDBCache("SELECT DISTINCT strftime('%d',e.published,'unixepoch')
FROM {$database['prefix']}Entries e
WHERE e.blogid = $blogid AND e.draft = 0 $visibility AND e.category >= 0 AND strftime('%Y',e.published,'unixepoch') = {$calendar['year']} AND strftime('%m',e.published,'unixepoch') = {$calendar['month']}",'entry');
break;
case 'MySQL':
case 'MySQLi':
case 'PostgreSQL':
Expand Down
2 changes: 2 additions & 0 deletions library/model/blog.blogSetting.php
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,8 @@ function addBlog($blogid, $userid, $identify) {
}
$pool->reset('SkinSettings');
$pool->setAttribute('blogid',$blogid);
$pool->setAttribute('name','skin',true);
$pool->setAttribute('value',$ctx->getProperty('service.skin'),true);
if(!$pool->insert()) {
deleteBlog($blogid);
return 13;
Expand Down
Loading

0 comments on commit 1127e67

Please sign in to comment.