Skip to content

Commit

Permalink
edit for php 5.4
Browse files Browse the repository at this point in the history
  • Loading branch information
YJSoft committed Apr 2, 2014
1 parent 933452b commit ed63dfa
Show file tree
Hide file tree
Showing 507 changed files with 14,834 additions and 27 deletions.
4 changes: 2 additions & 2 deletions classes/db/DBCubrid.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,7 @@ function _executeInsertAct ($output)
}
}
}
else $this->_filterNumber(&$value);
else $this->_filterNumber($value);

$column_list[] = '"'.$name.'"';
$value_list[] = $value;
Expand Down Expand Up @@ -732,7 +732,7 @@ function _executeUpdateAct ($output)
$check_column = false;
$value = "'".$this->addQuotes ($value)."'";
}
else $this->_filterNumber(&$value);
else $this->_filterNumber($value);

$column_list[] = sprintf ("\"%s\" = %s", $name, $value);
}
Expand Down
2 changes: 1 addition & 1 deletion classes/db/DBFirebird.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,7 @@ function _executeInsertAct($output) {
else if($output->column_type[$name]!='number') {
// if(!$value) $value = 'null';
}
else $this->_filterNumber(&$value);
else $this->_filterNumber($value);

$column_list[] = '"'.$name.'"';
$value_list[] = $value;
Expand Down
4 changes: 2 additions & 2 deletions classes/db/DBMssql.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ function _executeInsertAct($output) {
$value = '';
}
// sql injection 문제로 xml 선언이 number인 경우이면서 넘어온 값이 숫자형이 아니면 숫자형으로 강제 형변환
else $this->_filterNumber(&$value);
else $this->_filterNumber($value);

$column_list[] = '['.$name.']';
$value_list[] = '?';
Expand Down Expand Up @@ -593,7 +593,7 @@ function _executeUpdateAct($output) {
$column_list[] = sprintf("[%s] = ?", $name);
}else{
if(!$value) $value = '';
$this->_filterNumber(&$value);
$this->_filterNumber($value);
$column_list[] = sprintf("[%s] = %s", $name, $value);
}
}
Expand Down
4 changes: 2 additions & 2 deletions classes/db/DBMysql.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ function _executeInsertAct($output) {

}
//elseif(!$value || is_numeric($value)) $value = (int)$value;
else $this->_filterNumber(&$value);
else $this->_filterNumber($value);

$column_list[] = '`'.$name.'`';
$value_list[] = $value;
Expand All @@ -484,7 +484,7 @@ function _executeUpdateAct($output) {
if(strpos($name,'.')!==false&&strpos($value,'.')!==false) $column_list[] = $name.' = '.$value;
else {
if($output->column_type[$name]!='number') $value = "'".$this->addQuotes($value)."'";
else $this->_filterNumber(&$value);
else $this->_filterNumber($value);

$column_list[] = sprintf("`%s` = %s", $name, $value);
}
Expand Down
4 changes: 2 additions & 2 deletions classes/db/DBPostgresql.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,7 @@ function _executeInsertAct($output)
}
// sql injection 문제로 xml 선언이 number인 경우이면서 넘어온 값이 숫자형이 아니면 숫자형으로 강제 형변환
// elseif (!$value || is_numeric($value)) $value = (int)$value;
else $this->_filterNumber(&$value);
else $this->_filterNumber($value);

$column_list[] = $name;
$value_list[] = $value;
Expand Down Expand Up @@ -618,7 +618,7 @@ function _executeUpdateAct($output)
if ($output->column_type[$name] != 'number')
$value = "'" . $this->addQuotes($value) . "'";
// sql injection 문제로 xml 선언이 number인 경우이면서 넘어온 값이 숫자형이 아니면 숫자형으로 강제 형변환
else $this->_filterNumber(&$value);
else $this->_filterNumber($value);

$column_list[] = sprintf("%s = %s", $name, $value);
}
Expand Down
4 changes: 2 additions & 2 deletions classes/db/DBSqlite2.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ function _executeInsertAct($output) {
}
// sql injection 문제로 xml 선언이 number인 경우이면서 넘어온 값이 숫자형이 아니면 숫자형으로 강제 형변환
// elseif(!$value || is_numeric($value)) $value = (int)$value;
else $this->_filterNumber(&$value);
else $this->_filterNumber($value);

$column_list[] = $name;
$value_list[] = $value;
Expand Down Expand Up @@ -464,7 +464,7 @@ function _executeUpdateAct($output) {
else {
if($output->column_type[$name]!='number') $value = "'".$this->addQuotes($value)."'";
// sql injection 문제로 xml 선언이 number인 경우이면서 넘어온 값이 숫자형이 아니면 숫자형으로 강제 형변환
else $this->_filterNumber(&$value);
else $this->_filterNumber($value);

$column_list[] = sprintf("%s = %s", $name, $value);
}
Expand Down
4 changes: 2 additions & 2 deletions classes/db/DBSqlite3_pdo.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ function _executeInsertAct($output) {

if($output->column_type[$name]!='number') $val_list[] = $this->addQuotes($value);
else {
$this->_filterNumber(&$value);
$this->_filterNumber($value);
$val_list[] = $value;
}

Expand Down Expand Up @@ -499,7 +499,7 @@ function _executeUpdateAct($output) {
if(strpos($name,'.')!==false&&strpos($value,'.')!==false) $column_list[] = $name.' = '.$value;
else {
if($output->column_type[$name]!='number') $value = "'".$this->addQuotes($value)."'";
else $this->_filterNumber(&$value);
else $this->_filterNumber($value);

$column_list[] = sprintf("%s = %s", $name, $value);
}
Expand Down
21 changes: 11 additions & 10 deletions config/config.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@
* @brief 기본적으로 사용하는 class파일의 include 및 환경 설정을 함
**/

if(version_compare(PHP_VERSION, '5.4.0', '<'))
{
@error_reporting(E_ALL ^ E_NOTICE ^ E_DEPRECATED ^ E_WARNING);
}
else
{
@error_reporting(E_ALL ^ E_NOTICE ^ E_DEPRECATED ^ E_WARNING ^ E_STRICT);
}
if(version_compare(PHP_VERSION, '5.4.0', '<'))
{
@error_reporting(E_ALL ^ E_NOTICE ^ E_DEPRECATED ^ E_WARNING);
}
else
{
@error_reporting(E_ALL ^ E_NOTICE ^ E_DEPRECATED ^ E_WARNING ^ E_STRICT);
//@error_reporting(E_ALL ^ E_NOTICE ^ E_DEPRECATED ^ E_STRICT);
}

if(!defined('__ZBXE__')) exit();

Expand All @@ -23,7 +24,7 @@
* @brief XE의 전체 버전 표기
* 이 파일의 수정이 없더라도 공식 릴리즈시에 수정되어 함께 배포되어야 함
**/
define('__ZBXE_VERSION__', '1.4.5.23-alpha1');
define('__ZBXE_VERSION__', '1.4.5.22');

/**
* @brief zbXE가 설치된 장소의 base path를 구함
Expand Down Expand Up @@ -171,4 +172,4 @@
require(_XE_PATH_.'classes/security/Security.class.php');
if(__DEBUG__) $GLOBALS['__elapsed_class_load__'] = getMicroTime() - __ClassLoadStartTime__;
}
?>
?>
4 changes: 2 additions & 2 deletions modules/admin/admin.admin.view.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ function loadSideBar()
**/
function dispAdminIndex() {
//Retrieve recent news and set them into context
$newest_news_url = sprintf("http://news.xpressengine.com/%s/news.php", Context::getLangType());
$newest_news_url = sprintf("http://xzetnews.yjsoft.pe.kr/news.php?lang=%s", Context::getLangType());
$cache_file = sprintf("%sfiles/cache/newest_news.%s.cache.php", _XE_PATH_,Context::getLangType());
if(!file_exists($cache_file) || filemtime($cache_file)+ 60*60 < time()) {
// Considering if data cannot be retrieved due to network problem, modify filemtime to prevent trying to reload again when refreshing administration page
Expand Down Expand Up @@ -360,4 +360,4 @@ function dispAdminConfig() {
$this->setTemplateFile('config');
}
}
?>
?>
Binary file added modules/board (3).zip
Binary file not shown.
96 changes: 96 additions & 0 deletions modules/board/board.admin.controller.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
<?php
/**
* @class boardAdminController
* @author zero ([email protected])
* @brief board 모듈의 admin controller class
**/

class boardAdminController extends board {

/**
* @brief 초기화
**/
function init() {
}

/**
* @brief 게시판 추가
**/
function procBoardAdminInsertBoard($args = null) {
// module 모듈의 model/controller 객체 생성
$oModuleController = &getController('module');
$oModuleModel = &getModel('module');

// 게시판 모듈의 정보 설정
$args = Context::getRequestVars();
$args->module = 'board';
$args->mid = $args->board_name;
unset($args->board_name);

// 기본 값외의 것들을 정리
if($args->use_category!='Y') $args->use_category = 'N';
if($args->except_notice!='Y') $args->except_notice = 'N';
if($args->use_anonymous!='Y') $args->use_anonymous= 'N';
if($args->consultation!='Y') $args->consultation = 'N';
if(!in_array($args->order_target,$this->order_target)) $args->order_target = 'list_order';
if(!in_array($args->order_type,array('asc','desc'))) $args->order_type = 'asc';

// module_srl이 넘어오면 원 모듈이 있는지 확인
if($args->module_srl) {
$module_info = $oModuleModel->getModuleInfoByModuleSrl($args->module_srl);
if($module_info->module_srl != $args->module_srl) unset($args->module_srl);
}

// module_srl의 값에 따라 insert/update
if(!$args->module_srl) {
$output = $oModuleController->insertModule($args);
$msg_code = 'success_registed';
} else {
$output = $oModuleController->updateModule($args);
$msg_code = 'success_updated';
}

if(!$output->toBool()) return $output;

$this->add('page',Context::get('page'));
$this->add('module_srl',$output->get('module_srl'));
$this->setMessage($msg_code);
}

/**
* @brief 게시판 삭제
**/
function procBoardAdminDeleteBoard() {
$module_srl = Context::get('module_srl');

// 원본을 구해온다
$oModuleController = &getController('module');
$output = $oModuleController->deleteModule($module_srl);
if(!$output->toBool()) return $output;

$this->add('module','board');
$this->add('page',Context::get('page'));
$this->setMessage('success_deleted');
}

/**
* @brief 게시판 목록 지정
**/
function procBoardAdminInsertListConfig() {
$module_srl = Context::get('module_srl');
$list = explode(',',Context::get('list'));
if(!count($list)) return new Object(-1, 'msg_invalid_request');

$list_arr = array();
foreach($list as $val) {
$val = trim($val);
if(!$val) continue;
if(substr($val,0,10)=='extra_vars') $val = substr($val,10);
$list_arr[] = $val;
}

$oModuleController = &getController('module');
$oModuleController->insertModulePartConfig('board', $module_srl, $list_arr);
}
}
?>
Loading

0 comments on commit ed63dfa

Please sign in to comment.