@@ -78,7 +78,6 @@ public function post() {
78
78
79
79
if (!$ blogId ) {
80
80
$ this ->plugin ->setResponse ( $ this ->getErrorResponse (404 , 'Invalid Blog ' ) );
81
- return ;
82
81
}
83
82
84
83
// @task: Cleanup posted values.
@@ -94,7 +93,6 @@ public function post() {
94
93
if (! $ this ->_validateFields ($ post ))
95
94
{
96
95
$ this ->plugin ->setResponse ( $ this ->getErrorResponse (500 , $ this ->err [0 ]) );
97
- return ;
98
96
}
99
97
100
98
// @task: Akismet detection service.
@@ -111,7 +109,6 @@ public function post() {
111
109
if ( EasyBlogHelper::getHelper ( 'Akismet ' )->isSpam ( $ data ) )
112
110
{
113
111
$ this ->plugin ->setResponse ( $ this ->getErrorResponse (500 , JText::_ ('COM_EASYBLOG_SPAM_DETECTED_IN_COMMENT ' )) );
114
- return false ;
115
112
}
116
113
}
117
114
@@ -131,11 +128,6 @@ public function post() {
131
128
// @task: Bind posted values into the table.
132
129
$ comment ->bindPost ( $ post );
133
130
134
- if ( !EasyBlogHelper::getHelper ( 'Captcha ' )->verify ( $ post ) )
135
- {
136
- return EasyBlogHelper::getHelper ( 'Captcha ' )->getError ( $ ajax , $ post );
137
- }
138
-
139
131
// @task: Process registrations
140
132
$ registerUser = isset ( $ post [ 'esregister ' ] ) ? true : false ;
141
133
$ fullname = isset ( $ post [ 'name ' ] ) ? $ post ['name ' ] : '' ;
@@ -151,11 +143,7 @@ public function post() {
151
143
152
144
if ( !is_numeric ( $ state ) )
153
145
{
154
- $ ajax ->script ( "eblog.loader.doneLoading(); " );
155
- $ ajax ->script ( 'eblog.comment.displayInlineMsg( "error" , " ' . $ state . '"); ' );
156
- EasyBlogHelper::getHelper ( 'Captcha ' )->reload ( $ ajax , $ post );
157
-
158
- return $ ajax ->send ();
146
+ $ this ->plugin ->setResponse ( $ this ->getErrorResponse (500 , $ state ) );
159
147
}
160
148
161
149
$ newUserId = $ state ;
@@ -201,13 +189,6 @@ public function post() {
201
189
$ this ->plugin ->setResponse ( $ this ->getErrorResponse (500 , 'There was a problem saving the comment ' ) );
202
190
}
203
191
204
- $ message = JText::_ ('COM_EASYBLOG_COMMENTS_SUCCESS ' );
205
-
206
- if ( $ newUserId != 0 && $ registerUser )
207
- {
208
- $ message = JText::_ ('COM_EASYBLOG_COMMENTS_SUCCESS_AND_REGISTERED ' );
209
- }
210
-
211
192
// @rule: Process subscription for blog automatically when the user submits a new comment and wants to subscribe to the blog.
212
193
if ( $ subscribeBlog && $ config ->get ( 'main_subscription ' ) && $ blog ->subscription )
213
194
{
@@ -333,16 +314,6 @@ function _validateFields($post)
333
314
}
334
315
}
335
316
336
- if ($ config ->get ('comment_tnc ' ) == true && ( ( $ config ->get ('comment_tnc_users ' ) == 0 && $ my ->id <=0 ) || ( $ config ->get ('comment_tnc_users ' ) == 1 && $ my ->id >= 0 ) || ( $ config ->get ('comment_tnc_users ' ) == 2 ) ) )
337
- {
338
- if (empty ($ post ['tnc ' ]))
339
- {
340
- $ this ->err [0 ] = JText::_ ( 'COM_EASYBLOG_YOU_MUST_ACCEPT_TNC ' );
341
- $ this ->err [1 ] = 'tnc ' ;
342
- return false ;
343
- }
344
- }
345
-
346
317
return true ;
347
318
}
348
319
0 commit comments