diff --git a/classes/cache/CacheFile.class.php b/classes/cache/CacheFile.class.php
index 7dcd5cea98..bbd222b1fa 100644
--- a/classes/cache/CacheFile.class.php
+++ b/classes/cache/CacheFile.class.php
@@ -73,10 +73,13 @@ function isSupport()
function put($key, $obj, $valid_time = 0)
{
$cache_file = $this->getCacheFileName($key);
+ $data = serialize($obj);
+ $data = str_replace('\\', '\\\\', $data);
+ $data = str_replace('\'', '\\\'', $data);
$content = array();
$content[] = 'makeConfigFile();
}
+ if(version_compare(PHP_VERSION, '7.0', '>='))
+ {
+ $db_info->master_db["db_type"] = preg_replace('/^mysql(_.+)?$/', 'mysqli$1', $db_info->master_db["db_type"]);
+ foreach($db_info->slave_db as &$slave_db_info)
+ {
+ $slave_db_info["db_type"] = preg_replace('/^mysql(_.+)?$/', 'mysqli$1', $slave_db_info["db_type"]);
+ }
+ }
+
if(!$db_info->use_prepared_statements)
{
$db_info->use_prepared_statements = 'Y';
@@ -1287,6 +1297,7 @@ function _setJSONRequestArgument()
foreach($params as $key => $val)
{
+ $key = htmlentities($key);
$this->set($key, $this->_filterRequestVar($key, $val, 1), TRUE);
}
}
diff --git a/config/config.inc.php b/config/config.inc.php
index 4caa8f7908..981ec4d167 100644
--- a/config/config.inc.php
+++ b/config/config.inc.php
@@ -29,7 +29,7 @@
/**
* Display XE's full version.
*/
-define('__XE_VERSION__', '1.11.1');
+define('__XE_VERSION__', '1.11.2');
define('__XE_VERSION_ALPHA__', (stripos(__XE_VERSION__, 'alpha') !== false));
define('__XE_VERSION_BETA__', (stripos(__XE_VERSION__, 'beta') !== false));
define('__XE_VERSION_RC__', (stripos(__XE_VERSION__, 'rc') !== false));
diff --git a/modules/comment/comment.controller.php b/modules/comment/comment.controller.php
index a202ac1e1b..c000f4a238 100644
--- a/modules/comment/comment.controller.php
+++ b/modules/comment/comment.controller.php
@@ -1095,35 +1095,44 @@ function updateVotedCount($comment_srl, $point = 1)
return new BaseObject(-1, $failed_voted);
}
+ // Call a trigger (before)
+ $trigger_obj = new stdClass;
+ $trigger_obj->member_srl = $oComment->get('member_srl');
+ $trigger_obj->module_srl = $oComment->get('module_srl');
+ $trigger_obj->document_srl = $oComment->get('document_srl');
+ $trigger_obj->comment_srl = $oComment->get('comment_srl');
+ $trigger_obj->update_target = ($point < 0) ? 'blamed_count' : 'voted_count';
+ $trigger_obj->point = $point;
+ $trigger_obj->before_point = ($point < 0) ? $oComment->get('blamed_count') : $oComment->get('voted_count');
+ $trigger_obj->after_point = $trigger_obj->before_point + $point;
+ $trigger_output = ModuleHandler::triggerCall('comment.updateVotedCount', 'before', $trigger_obj);
+ if(!$trigger_output->toBool())
+ {
+ return $trigger_output;
+ }
+
// begin transaction
$oDB = DB::getInstance();
$oDB->begin();
// update the number of votes
- if($point < 0)
+ if($trigger_obj->update_target === 'blamed_count')
{
- $args->blamed_count = $oComment->get('blamed_count') + $point;
+ $args->blamed_count = $trigger_obj->after_point;
$output = executeQuery('comment.updateBlamedCount', $args);
}
else
{
- $args->voted_count = $oComment->get('voted_count') + $point;
+ $args->voted_count = $trigger_obj->after_point;
$output = executeQuery('comment.updateVotedCount', $args);
}
// leave logs
- $args->point = $point;
+ $args->point = $trigger_obj->point;
$output = executeQuery('comment.insertCommentVotedLog', $args);
- $obj = new stdClass();
- $obj->member_srl = $oComment->get('member_srl');
- $obj->module_srl = $oComment->get('module_srl');
- $obj->comment_srl = $oComment->get('comment_srl');
- $obj->update_target = ($point < 0) ? 'blamed_count' : 'voted_count';
- $obj->point = $point;
- $obj->before_point = ($point < 0) ? $oComment->get('blamed_count') : $oComment->get('voted_count');
- $obj->after_point = ($point < 0) ? $args->blamed_count : $args->voted_count;
- $trigger_output = ModuleHandler::triggerCall('comment.updateVotedCount', 'after', $obj);
+ // Call a trigger (after)
+ $trigger_output = ModuleHandler::triggerCall('comment.updateVotedCount', 'after', $trigger_obj);
if(!$trigger_output->toBool())
{
$oDB->rollback();
@@ -1137,13 +1146,13 @@ function updateVotedCount($comment_srl, $point = 1)
// Return the result
$output = new BaseObject(0, $success_message);
- if($point > 0)
+ if($trigger_obj->update_target === 'voted_count')
{
- $output->add('voted_count', $obj->after_point);
+ $output->add('voted_count', $trigger_obj->after_point);
}
else
{
- $output->add('blamed_count', $obj->after_point);
+ $output->add('blamed_count', $trigger_obj->after_point);
}
return $output;
diff --git a/modules/comment/comment.model.php b/modules/comment/comment.model.php
index a643de3367..a2b1aadb5b 100644
--- a/modules/comment/comment.model.php
+++ b/modules/comment/comment.model.php
@@ -508,6 +508,13 @@ function getCommentList($document_srl, $page = 0, $is_admin = FALSE, $count = 0)
$args->status = 1;
}
+ // call trigger (before)
+ $trigger_output = ModuleHandler::triggerCall('comment.getCommentList', 'before', $args);
+ if($trigger_output instanceof BaseObject && !$trigger_output->toBool())
+ {
+ return $output;
+ }
+
$output = executeQueryArray('comment.getCommentPageList', $args);
// return if an error occurs in the query results
@@ -527,6 +534,13 @@ function getCommentList($document_srl, $page = 0, $is_admin = FALSE, $count = 0)
}
}
+ // call trigger (after)
+ $trigger_output = ModuleHandler::triggerCall('comment.getCommentList', 'after', $output);
+ if($trigger_output instanceof BaseObject && !$trigger_output->toBool())
+ {
+ return $trigger_output;
+ }
+
return $output;
}
diff --git a/modules/communication/communication.controller.php b/modules/communication/communication.controller.php
index 88a04b26ac..7abfd9f848 100644
--- a/modules/communication/communication.controller.php
+++ b/modules/communication/communication.controller.php
@@ -125,6 +125,8 @@ function procCommunicationSendMessage()
return $output;
}
+ $message_srl = $output->get('message_srl');
+
// send an e-mail
if($send_mail == 'Y')
{
@@ -140,7 +142,7 @@ function procCommunicationSendMessage()
if(!in_array(Context::getRequestMethod(), array('XMLRPC', 'JSON')))
{
- if(Context::get('is_popup') != 'Y')
+ if(Context::get('is_popup') === 'Y')
{
global $lang;
htmlHeader();
@@ -153,7 +155,7 @@ function procCommunicationSendMessage()
else
{
$this->setMessage('success_sended');
- $returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('','act', 'dispCommunicationMessages', 'message_type', 'S', 'receiver_srl', $receiver_srl, 'message_srl', '');
+ $returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('act', 'dispCommunicationMessages', 'message_type', 'S', 'message_srl', $message_srl);
$this->setRedirectUrl($returnUrl);
}
}
@@ -262,7 +264,10 @@ function sendMessage($sender_srl, $receiver_srl, $title, $content, $sender_log =
$oDB->commit();
- return new BaseObject(0, 'success_sended');
+ $result = new BaseObject(0, 'success_sended');
+ $result->add('message_srl', $message_srl);
+
+ return $result;
}
/**
diff --git a/modules/communication/communication.mobile.php b/modules/communication/communication.mobile.php
index e131da444d..bd5ef2de0c 100644
--- a/modules/communication/communication.mobile.php
+++ b/modules/communication/communication.mobile.php
@@ -178,7 +178,24 @@ function dispCommunicationSendMessage()
return $this->stop('msg_invalid_request');
}
+ $oEditorModel = getModel('editor');
+ $option = new stdClass();
+ $option->primary_key_name = 'receiver_srl';
+ $option->content_key_name = 'new_content';
+ $option->allow_fileupload = FALSE;
+ $option->enable_autosave = FALSE;
+ $option->enable_default_component = TRUE;
+ $option->enable_component = FALSE;
+ $option->resizable = FALSE;
+ $option->disable_html = TRUE;
+ $option->height = 150;
+ $option->skin = $this->communication_config->editor_skin;
+ $option->colorset = $this->communication_config->editor_colorset;
+ $editor = $oEditorModel->getEditor($logged_info->member_srl, $option);
+
Context::set('receiver_info', $receiver_info);
+ Context::set('editor', $editor);
+
$this->setTemplateFile('send_message');
}
diff --git a/modules/communication/m.skins/default/js/communication.js b/modules/communication/m.skins/default/js/communication.js
index e37272d415..65c0e810b3 100644
--- a/modules/communication/m.skins/default/js/communication.js
+++ b/modules/communication/m.skins/default/js/communication.js
@@ -13,10 +13,20 @@ function completeDeleteMessage(ret_obj) {
location.href = current_url.setQuery('message_srl','');
}
-function mergeContents()
-{
- var $form = jQuery('#fo_comm');
- var content = $form.find('textarea[name=new_content]').val() + $form.find('input[name=source_content]').val();
- $form.find('input[name=content]').val(content);
- $form.submit();
+function mergeContents(data) {
+ var $form = jQuery('#fo_comm')
+ var editotSequence = data.editor_sequence || null
+ var content = ''
+ var sourceContent = $form.find('input[name=source_content]').val() || ''
+
+ if (editotSequence) {
+ content = editorGetContent(editotSequence)
+ } else {
+ content = $form.find('[name=new_content]').val()
+ }
+
+ content += sourceContent
+
+ $form.find('input[name=content]').val(content)
+ $form.submit()
}
diff --git a/modules/communication/m.skins/default/send_message.html b/modules/communication/m.skins/default/send_message.html
index 1b7c1834ca..c3d4f1470d 100644
--- a/modules/communication/m.skins/default/send_message.html
+++ b/modules/communication/m.skins/default/send_message.html
@@ -9,13 +9,11 @@
{$lang->cmd_send_message}
diff --git a/modules/communication/skins/default/send_message.html b/modules/communication/skins/default/send_message.html
index 1adf2984ee..aabf5cfd23 100644
--- a/modules/communication/skins/default/send_message.html
+++ b/modules/communication/skins/default/send_message.html
@@ -8,7 +8,8 @@ {$lang->cmd_send_message}