Skip to content

Commit 305e810

Browse files
author
bnu
committed
Merge branch 'release/1.8.1'
2 parents 328ebdc + 5005f1d commit 305e810

File tree

185 files changed

+5410
-8827
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

185 files changed

+5410
-8827
lines changed

.travis.yml

+3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@ php:
66
- 5.6
77
- hhvm
88
before_script:
9+
- travis_retry composer self-update
910
- npm install -g grunt-cli
1011
- npm install
12+
- if [ $(phpenv version-name) != "5.3" ]; then composer install; fi
1113
script:
1214
- grunt lint
15+
- if [ $(phpenv version-name) != "5.3" ]; then ./vendor/bin/codecept run; fi

classes/db/DB.class.php

+9-14
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ class DB
166166
* leve of transaction
167167
* @var unknown
168168
*/
169-
private $transationNestedLevel = 0;
169+
private $transactionNestedLevel = 0;
170170

171171
/**
172172
* returns instance of certain db type
@@ -314,11 +314,6 @@ function _getSupportedList()
314314
{
315315
$db_type = $supported_list[$i];
316316

317-
if(version_compare(phpversion(), '5.0') < 0 && preg_match('/pdo/i', $db_type))
318-
{
319-
continue;
320-
}
321-
322317
$class_name = sprintf("DB%s%s", strtoupper(substr($db_type, 0, 1)), strtolower(substr($db_type, 1)));
323318
$class_file = sprintf(_XE_PATH_ . "classes/db/%s.class.php", $class_name);
324319
if(!file_exists($class_file))
@@ -1142,10 +1137,10 @@ function begin()
11421137
return;
11431138
}
11441139

1145-
if($this->_begin($this->transationNestedLevel))
1140+
if($this->_begin($this->transactionNestedLevel))
11461141
{
11471142
$this->transaction_started = TRUE;
1148-
$this->transationNestedLevel++;
1143+
$this->transactionNestedLevel++;
11491144
}
11501145
}
11511146

@@ -1169,11 +1164,11 @@ function rollback()
11691164
{
11701165
return;
11711166
}
1172-
if($this->_rollback($this->transationNestedLevel))
1167+
if($this->_rollback($this->transactionNestedLevel))
11731168
{
1174-
$this->transationNestedLevel--;
1169+
$this->transactionNestedLevel--;
11751170

1176-
if(!$this->transationNestedLevel)
1171+
if(!$this->transactionNestedLevel)
11771172
{
11781173
$this->transaction_started = FALSE;
11791174
}
@@ -1201,14 +1196,14 @@ function commit($force = FALSE)
12011196
{
12021197
return;
12031198
}
1204-
if($this->transationNestedLevel == 1 && $this->_commit())
1199+
if($this->transactionNestedLevel == 1 && $this->_commit())
12051200
{
12061201
$this->transaction_started = FALSE;
1207-
$this->transationNestedLevel = 0;
1202+
$this->transactionNestedLevel = 0;
12081203
}
12091204
else
12101205
{
1211-
$this->transationNestedLevel--;
1206+
$this->transactionNestedLevel--;
12121207
}
12131208
}
12141209

classes/mail/Mail.class.php

+1-8
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,7 @@
11
<?php
22
/* Copyright (C) NAVER <http://www.navercorp.com> */
33

4-
if(version_compare(PHP_VERSION, '5.0.0', '>='))
5-
{
6-
require_once _XE_PATH_ . "libs/phpmailer/phpmailer.php";
7-
}
8-
else
9-
{
10-
require_once _XE_PATH_ . "libs/phpmailer/class.phpmailer.php";
11-
}
4+
require_once _XE_PATH_ . "libs/phpmailer/phpmailer.php";
125

136
/**
147
* Mailing class for XpressEngine

classes/mobile/Mobile.class.php

+6-3
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,7 @@ function _isFromMobilePhone()
5252
{
5353
return $this->ismobile;
5454
}
55-
56-
$db_info = Context::getDBInfo();
57-
if($db_info->use_mobile_view != "Y" || Context::get('full_browse') || $_COOKIE["FullBrowse"])
55+
if(Mobile::isMobileEnabled() === false || Context::get('full_browse') || $_COOKIE["FullBrowse"])
5856
{
5957
return ($this->ismobile = false);
6058
}
@@ -234,5 +232,10 @@ function setMobile($ismobile)
234232
$oMobile->ismobile = $ismobile;
235233
}
236234

235+
function isMobileEnabled()
236+
{
237+
$db_info = Context::getDBInfo();
238+
return ($db_info->use_mobile_view === 'Y');
239+
}
237240
}
238241
?>

classes/module/ModuleHandler.class.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -667,7 +667,8 @@ function procModule()
667667
'dispEditorConfigPreview' => 1,
668668
'dispLayoutPreviewWithModule' => 1
669669
);
670-
if($type == "view" && $this->module_info->use_mobile == "Y" && Mobile::isMobileCheckByAgent() && !isset($skipAct[Context::get('act')]))
670+
$db_use_mobile = Mobile::isMobileEnabled();
671+
if($type == "view" && $this->module_info->use_mobile == "Y" && Mobile::isMobileCheckByAgent() && !isset($skipAct[Context::get('act')]) && $db_use_mobile === true)
671672
{
672673
global $lang;
673674
$header = '<style>div.xe_mobile{opacity:0.7;margin:1em 0;padding:.5em;background:#333;border:1px solid #666;border-left:0;border-right:0}p.xe_mobile{text-align:center;margin:1em 0}a.xe_mobile{color:#ff0;font-weight:bold;font-size:24px}@media only screen and (min-width:500px){a.xe_mobile{font-size:15px}}</style>';

classes/security/Password.class.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ public function createHash($password, $algorithm = null)
111111

112112
case 'pbkdf2':
113113
$iterations = pow(2, $this->getWorkFactor() + 5);
114-
$salt = $this->createSecureSalt(12);
114+
$salt = $this->createSecureSalt(12, 'alnum');
115115
$hash = base64_encode($this->pbkdf2($password, $salt, 'sha256', $iterations, 24));
116116
return 'sha256:'.sprintf('%07d', $iterations).':'.$salt.':'.$hash;
117117

classes/template/TemplateHandler.class.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ static public function &getInstance()
6868
* @param string $tpl_file
6969
* @return void
7070
*/
71-
private function init($tpl_path, $tpl_filename, $tpl_file = '')
71+
protected function init($tpl_path, $tpl_filename, $tpl_file = '')
7272
{
7373
// verify arguments
7474
if(substr($tpl_path, -1) != '/')
@@ -213,7 +213,7 @@ public function compileDirect($tpl_path, $tpl_filename)
213213
* @param string $buff template file
214214
* @return string compiled result in case of success or NULL in case of error
215215
*/
216-
private function parse($buff = null)
216+
protected function parse($buff = null)
217217
{
218218
if(is_null($buff))
219219
{

codeception.yml

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
actor: Tester
2+
paths:
3+
tests: tests
4+
log: tests/_output
5+
data: tests/_data
6+
helpers: tests/_support
7+
settings:
8+
bootstrap: _bootstrap.php
9+
colors: true
10+
memory_limit: 1024M
11+
modules:
12+
config:
13+
Db:
14+
dsn: ''
15+
user: ''
16+
password: ''
17+
dump: tests/_data/dump.sql
18+
error_level: "E_STRICTE_ALL & ~E_WARNING & ~E_STRICT & ~E_DEPRECATED & ~E_NOTICE"

common/js/plugins/jquery.fileupload/js/main.js

+17-8
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,25 @@
5656

5757
var settings = {
5858
url: request_uri.setQuery('module', 'file').setQuery('act', 'procFileUpload'),
59-
formData: {"editor_sequence": data.editorSequence, "upload_target_srl" : data.uploadTargetSrl},
59+
formData: {"editor_sequence": data.editorSequence, "upload_target_srl" : data.uploadTargetSrl, "mid" : window.current_mid},
6060

6161
dropZone: $container,
62+
add: function(e, data) {
63+
var dfd = jQuery.Deferred();
64+
65+
$.each(data.files, function(index, file) {
66+
if(self.settings.maxFileSize <= file.size) {
67+
dfd.reject();
68+
alert(window.xe.msg_exceeds_limit_size);
69+
return false;
70+
}
71+
dfd.resolve();
72+
});
73+
74+
dfd.done(function(){
75+
data.submit();
76+
});
77+
},
6278
done: function(e, res) {
6379
var result = res.response().result;
6480

@@ -69,20 +85,13 @@
6985
if(!result) return;
7086

7187
if(result.error == 0) {
72-
// self.done.call(self, arguments);
7388
} else {
7489
alert(result.message);
7590
}
7691
},
7792
stop: function() {
7893
self.loadFilelist();
7994
},
80-
drop: function(e, data) {
81-
},
82-
change: function(e, data) {
83-
},
84-
always: function() {
85-
},
8695
start: function() {
8796
self.settings.progressbarGraph.width(0);
8897
self.settings.progressStatus.show();

common/js/plugins/jquery.fileupload/js/main.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

composer.json

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"name": "xpressengine/xe-core",
3+
"license": "GNU LGPL",
4+
"authors": [
5+
{
6+
"name": "NAVER",
7+
"email": "developers@xpressengine.com"
8+
}
9+
],
10+
"require": {
11+
},
12+
"require-dev": {
13+
"codeception/codeception": "~2.0",
14+
"codeception/verify": "0.2.*",
15+
"codeception/specify": "0.4.*"
16+
}
17+
}

0 commit comments

Comments
 (0)