diff --git a/interface/blog/comment/comment/index.php b/interface/blog/comment/comment/index.php
index 60871e958..d7c98868d 100644
--- a/interface/blog/comment/comment/index.php
+++ b/interface/blog/comment/comment/index.php
@@ -3,6 +3,8 @@
/// All rights reserved. Licensed under the GPL.
/// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT)
define('__TEXTCUBE_ADMINPANEL__',true);
+require ROOT . '/library/preprocessor.php';
+requireModel('blog.comment');
$IV = array(
'POST' => array(
'name' => array('string', 'default' => ''),
@@ -13,8 +15,11 @@
'secret' => array(array('on'), 'default' => null)
)
);
-require ROOT . '/library/preprocessor.php';
-requireModel('blog.comment');
+$customIV = fireEvent('ManipulateIVRules',$IV,$context->getProperty('uri.interfaceRoute'));
+Validator::addRule($customIV);
+if(!Validator::isValid())
+ Respond::PrintResult(array('error' => 1, 'description' => 'Illegal parameters'));
+requireStrictRoute();
if (!Setting::getBlogSettingGlobal('acceptComments',0) && !doesHaveOwnership()) {
Respond::PrintResult(array('error' => 0, 'commentBlock' => '', 'recentCommentBlock' => ''));
diff --git a/library/view/replyEditorView.php b/library/view/replyEditorView.php
index 9ba17ccdb..317346907 100644
--- a/library/view/replyEditorView.php
+++ b/library/view/replyEditorView.php
@@ -19,23 +19,26 @@
}
}
+$context = Model_Context::getInstance();
$pageHeadTitle = $pageTitle;
if( Acl::getIdentity('openid') ) {
$pageHeadTitle = $pageTitle;
$pageTitle = "$pageTitle ( ".OpenID::getDisplayName(Acl::getIdentity('openid')).")";
}
?>
-
-
+
+
@@ -73,7 +76,7 @@ function confirmOverwrite() {
}
//]]>
-
+
-
+
diff --git a/plugins/reCAPTCHA/index.php b/plugins/reCAPTCHA/index.php
index b764c6c17..9a87acef6 100644
--- a/plugins/reCAPTCHA/index.php
+++ b/plugins/reCAPTCHA/index.php
@@ -2,7 +2,7 @@
function Recaptcha_AddInputValidatorRule($target, $mother) {
$signed_in = (doesHaveOwnership() || doesHaveMembership());
- if ($mother == 'interface/blog/comment/add/') {
+ if ($mother == 'interface/blog/comment/add/' || $mother == 'interface/blog/comment/comment/') {
$target['POST']['g-recaptcha-response'] = array('string', 'default' => '', 'mandatory' => !$signed_in);
}
return $target;
@@ -40,6 +40,28 @@ function recaptchaWaitForElement(selector, cb) {
return $target;
}
+function Recaptcha_CCHeader($target) {
+ global $configVal, $pluginURL;
+ $config = Setting::fetchConfigVal($configVal);
+ if (!is_null($config) && isset($config['siteKey'])) {
+ $target .= <<
+function recaptcha_init() {
+ var $ = jQuery;
+ if (!doesHaveOwnership) {
+ $('form').find('textarea').after('');
+ grecaptcha.render('comment_recaptcha', {
+ 'sitekey': '{$config['siteKey']}'
+ });
+ }
+}
+
+
+EOS;
+ }
+ return $target;
+}
+
function Recaptcha_Footer($target) {
global $configVal, $pluginURL;
$config = Setting::fetchConfigVal($configVal);
@@ -47,19 +69,21 @@ function Recaptcha_Footer($target) {
$target .= <<
(function($) {
-if (!doesHaveOwnership) {
- $('a[id^=commentCount]').click(function(e) {
- var entryId = $(e.target).attr('id').match(/(\d+)/)[1];
- recaptchaWaitForElement('form[id=entry' + entryId + 'WriteComment]', function(f) {
- var blockId = 'comment_recaptcha_' + entryId;
- if ($(blockId).length > 0) return;
- $(f).find('textarea').after('');
- grecaptcha.render(blockId, {
- 'sitekey': '{$config['siteKey']}'
+$(document).ready(function() {
+ if (!doesHaveOwnership) {
+ $('a[id^=commentCount]').click(function(e) {
+ var entryId = $(e.target).attr('id').match(/(\d+)/)[1];
+ recaptchaWaitForElement('form[id=entry' + entryId + 'WriteComment]', function(f) {
+ var blockId = 'comment_recaptcha_' + entryId;
+ if ($(blockId).length > 0) return;
+ $(f).find('textarea').after('');
+ grecaptcha.render(blockId, {
+ 'sitekey': '{$config['siteKey']}'
+ });
});
});
- });
-}
+ }
+});
})(jQuery);
EOS;
diff --git a/plugins/reCAPTCHA/index.xml b/plugins/reCAPTCHA/index.xml
index b14eeb413..bb93e2882 100644
--- a/plugins/reCAPTCHA/index.xml
+++ b/plugins/reCAPTCHA/index.xml
@@ -18,6 +18,7 @@
+