{"id":4317895,"date":"2013-11-14T14:50:10","date_gmt":"2013-11-14T14:50:10","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/ajax-bug-when-not-using-confirm-email\/"},"modified":"2016-08-21T12:34:01","modified_gmt":"2016-08-21T12:34:01","slug":"ajax-bug-when-not-using-confirm-email","status":"closed","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/ajax-bug-when-not-using-confirm-email\/","title":{"rendered":"Ajax Bug when not using Confirm Email"},"content":{"rendered":"<p>Hi Meghan<\/p>\n<p>Great plugin.  I&#8217;ve found a bug.  I&#8217;ve selected the ajax option and chosen not to have the confirm email address box.  The email gets sent but the confirmation message doesn&#8217;t display.  The ajax is trying to validate the confirm email field which doesn&#8217;t exist.  Here is the error I get in FireBug:<\/p>\n<pre><code>Status: parsererrorError: SyntaxError: JSON.parse: unexpected characterResponse: &lt;br \/&gt;\n&lt;b&gt;Notice&lt;\/b&gt;:  Undefined index: confirm-email in &lt;b&gt;\/var\/www\/bdstadia.co.uk\/htdocs\/europe\/wp-content\/plugins\/clean-and-simple-contact-form-by-meg-nicholas\/class.cscf_contact.php&lt;\/b&gt; on line &lt;b&gt;33&lt;\/b&gt;&lt;br \/&gt;\n{&quot;sent&quot;:true,&quot;valid&quot;:true,&quot;errorlist&quot;:[]}<\/code><\/pre>\n<p>I fixed it by changing the line to <\/p>\n<pre><code>if (isset($cscf[&#039;confirm-email&#039;])) {\n                $this-&gt;ConfirmEmail = filter_var($cscf[&#039;confirm-email&#039;], FILTER_SANITIZE_EMAIL);\n            }<\/code><\/pre>\n<p>Hope this helps.<\/p>\n<p>https:\/\/wordpress.org\/plugins\/clean-and-simple-contact-form-by-meg-nicholas\/<\/p>\n","protected":false},"template":"","class_list":["post-4317895","topic","type-topic","status-closed","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/4317895","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/4317895\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=4317895"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}