@@ -903,9 +903,9 @@ public function onAfterRoute()
903
903
'comment_type ' => 'feedback_general_contact_form ' ,
904
904
'post_url ' => isset ($ _SERVER ['HTTP_REFERER ' ]) ? $ _SERVER ['HTTP_REFERER ' ] : ''
905
905
);
906
- if ($ option_cmd == 'com_rsform ' )
906
+ if ($ app -> input -> get ( ' option ' ) == 'com_rsform ' )
907
907
$ post_info ['comment_type ' ] = 'contact_form_joomla_rsform ' ;
908
- if ($ option_cmd = 'com_baforms ' )
908
+ if ($ app -> input -> get ( ' option ' ) = = 'com_baforms ' )
909
909
$ post_info ['comment_type ' ] = 'contact_form_joomla_balbooa ' ;
910
910
//Rapid
911
911
if (isset ($ _POST ['rp_email ' ])){
@@ -961,9 +961,9 @@ public function onAfterRoute()
961
961
// Genertal test for any forms or form with custom fields
962
962
elseif ($ config ['general_contact_forms_test ' ] ||
963
963
$ config ['check_external ' ] ||
964
- $ option_cmd == 'com_rsform ' ||
965
- $ option_cmd == 'com_virtuemart ' ||
966
- $ option_cmd == 'com_baforms ' )
964
+ $ app -> input -> get ( ' option ' ) == 'com_rsform ' ||
965
+ $ app -> input -> get ( ' option ' ) == 'com_virtuemart ' ||
966
+ $ app -> input -> get ( ' option ' ) == 'com_baforms ' )
967
967
{
968
968
$ ct_temp_msg_data = $ this ->getFieldsAny ($ _POST );
969
969
$ sender_email = ($ ct_temp_msg_data ['email ' ] ? $ ct_temp_msg_data ['email ' ] : '' );
@@ -984,10 +984,9 @@ public function onAfterRoute()
984
984
'sender_nickname ' => $ sender_nickname ,
985
985
'sender_email ' => $ sender_email ,
986
986
'message ' => trim (preg_replace ("/(^[ \r\n]*|[ \r\n]+)[\s \t]*[ \r\n]+/ " ,"\n" , $ message )),
987
- 'post_info ' => $ post_info ,
987
+ 'post_info ' => json_encode ( $ post_info) ,
988
988
)
989
989
);
990
-
991
990
if ($ ctResponse )
992
991
{
993
992
if (!empty ($ ctResponse ) && is_array ($ ctResponse ))
@@ -998,16 +997,18 @@ public function onAfterRoute()
998
997
{
999
998
if ($ ctResponse ['allow ' ] == 0 )
1000
999
{
1001
- if ($ option_cmd == 'com_baforms ' )
1000
+ if ($ app -> input -> get ( ' option ' ) == 'com_baforms ' )
1002
1001
{
1003
1002
echo '<input id="form-sys-mesage" type="hidden" value=" ' .htmlspecialchars ($ ctResponse ['comment ' ], ENT_QUOTES ). '"> ' ;
1004
1003
print "<script>var obj = { type : 'baform', msg : document.getElementById('form-sys-mesage').value }; window.parent.postMessage(obj, '*');</script> " ;
1004
+ die ();
1005
1005
}
1006
1006
else {
1007
1007
$ error_tpl =file_get_contents (dirname (__FILE__ )."/error.html " );
1008
- print str_replace ('%ERROR_TEXT% ' ,$ ctResponse ['comment ' ],$ error_tpl );
1008
+ print str_replace ('%ERROR_TEXT% ' ,$ ctResponse ['comment ' ],$ error_tpl );
1009
+ die ();
1009
1010
}
1010
- die ();
1011
+
1011
1012
}
1012
1013
elseif ($ ctResponse ['allow ' ] == 1 && $ config ['check_external ' ] && isset ($ _POST ['ct_action ' ], $ _POST ['ct_method ' ]))
1013
1014
{
@@ -1078,7 +1079,7 @@ public function onValidateContact(&$contact, &$data) {
1078
1079
'sender_nickname ' => $ data [$ user_name_key ],
1079
1080
'sender_email ' => $ data [$ user_email_key ],
1080
1081
'message ' => $ data [$ subject_key ] . "\n " . $ data [$ message_key ],
1081
- 'post_info ' => $ post_info ,
1082
+ 'post_info ' => json_encode ( $ post_info) ,
1082
1083
)
1083
1084
);
1084
1085
if ($ ctResponse )
@@ -1221,7 +1222,7 @@ public function onJCommentsCommentBeforeAdd(&$comment) {
1221
1222
'message ' =>preg_replace ('/\s+/ ' , ' ' ,str_replace ("<br /> " , " " , $ comment ->comment )),
1222
1223
'sender_nickname ' => $ comment ->name ,
1223
1224
'sender_email ' => $ comment ->email ,
1224
- 'post_info ' => $ post_info ,
1225
+ 'post_info ' => json_encode ( $ post_info) ,
1225
1226
)
1226
1227
);
1227
1228
if ($ ctResponse )
0 commit comments