{"id":600,"date":"2019-06-04T06:01:14","date_gmt":"2019-06-04T06:01:14","guid":{"rendered":"http:\/\/angelwings.net\/blog\/?p=600"},"modified":"2019-06-04T06:01:14","modified_gmt":"2019-06-04T06:01:14","slug":"prestashop-fake-customer-registrations-spam","status":"publish","type":"post","link":"https:\/\/angelwings.net\/blog\/prestashop-fake-customer-registrations-spam\/","title":{"rendered":"Prestashop: fake customer registrations spam"},"content":{"rendered":"<p>Source: https:\/\/www.prestashop.com\/forums\/topic\/981159-securite-spam-customer-account-solution-13-15\/<\/p>\n<p>within your class classes\/Validate.php &#8211; either in the native code, or into an override, add this function<\/p>\n<pre class=\"ipsCode prettyprint lang-html prettyprinted\"><span class=\"pln\">    public static function isCustomerName($name)\n    {\n        if (preg_match(Tools::cleanNonUnicodeSupport('\/www|http\/ui'),$name))\n           return false;\n\n        return preg_match(Tools::cleanNonUnicodeSupport('\/^[^0-9!\\[\\]&lt;&gt;,;?=+()@#\"\u00b0{}_$%:\\\/\\\\\\*\\^]*$\/u'), $name);\n    }<\/span><\/pre>\n<p>Then modify inside classes\/Customer.php<\/p>\n<pre class=\"ipsCode prettyprint lang-html prettyprinted\"><span class=\"pln\">            'lastname' =&gt;                    array('type' =&gt; self::TYPE_STRING, 'validate' =&gt; 'isName', 'required' =&gt; true, 'size' =&gt; 32),\n            'firstname' =&gt;                    array('type' =&gt; self::TYPE_STRING, 'validate' =&gt; 'isName', 'required' =&gt; true, 'size' =&gt; 32),<\/span><\/pre>\n<p>by<\/p>\n<pre class=\"ipsCode prettyprint lang-html prettyprinted\"><span class=\"pln\">            'lastname' =&gt;                    array('type' =&gt; self::TYPE_STRING, 'validate' =&gt; 'isCustomerName', 'required' =&gt; true, 'size' =&gt; 32),\n            'firstname' =&gt;                    array('type' =&gt; self::TYPE_STRING, 'validate' =&gt; 'isCustomerName', 'required' =&gt; true, 'size' =&gt; 32),<\/span><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Source: https:\/\/www.prestashop.com\/forums\/topic\/981159-securite-spam-customer-account-solution-13-15\/ within your class classes\/Validate.php &#8211; either in the native code, or into an override, add this function public static function isCustomerName($name) { if (preg_match(Tools::cleanNonUnicodeSupport(&#8216;\/www|http\/ui&#8217;),$name)) return false; return preg_match(Tools::cleanNonUnicodeSupport(&#8216;\/^[^0-9!\\[\\]&lt;&gt;,;?=+()@#&#8221;\u00b0{}_$%:\\\/\\\\\\*\\^]*$\/u&#8217;), $name); } Then modify inside classes\/Customer.php &#8216;lastname&#8217; =&gt; array(&#8216;type&#8217; =&gt; self::TYPE_STRING, &#8216;validate&#8217; =&gt; &#8216;isName&#8217;, &#8216;required&#8217; =&gt; true, &#8216;size&#8217; =&gt; 32), &#8216;firstname&#8217; =&gt; array(&#8216;type&#8217; =&gt; self::TYPE_STRING, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[28],"tags":[103,105],"class_list":["post-600","post","type-post","status-publish","format-standard","hentry","category-troubleshoot","tag-prestashop","tag-prestashop-1-6"],"_links":{"self":[{"href":"https:\/\/angelwings.net\/blog\/wp-json\/wp\/v2\/posts\/600","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/angelwings.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/angelwings.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/angelwings.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/angelwings.net\/blog\/wp-json\/wp\/v2\/comments?post=600"}],"version-history":[{"count":0,"href":"https:\/\/angelwings.net\/blog\/wp-json\/wp\/v2\/posts\/600\/revisions"}],"wp:attachment":[{"href":"https:\/\/angelwings.net\/blog\/wp-json\/wp\/v2\/media?parent=600"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/angelwings.net\/blog\/wp-json\/wp\/v2\/categories?post=600"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/angelwings.net\/blog\/wp-json\/wp\/v2\/tags?post=600"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}