2016-04-28 38 views
0

我在woocommerce网站的评论中看到这个错误。 我认为这个问题是与电子邮件,但如何解决呢 请帮助警告:strlen()期望参数1是字符串,对象在2481行的格式化.php中给出

警告:strlen的()预计参数1是字符串,对象formatting.php给出线2481

线2481第二行

<code> 
// Test for the minimum length the email can be 
if (strlen($email) < 3) { 
    /** 
    * Filter whether an email address is valid. 
    * 
    * This filter is evaluated under several different contexts, such as 'email_too_short', 
    * 'email_no_at', 'local_invalid_chars', 'domain_period_sequence', 'domain_period_limits', 
    * 'domain_no_periods', 'sub_hyphen_limits', 'sub_invalid_chars', or no specific context. 
</code> 
+2

你的错误意味着你正在传递一个对象到你的strlen函数。所以$ email是一个对象。 这个$电子邮件从哪里来? –

回答

0

谢谢您的回答我的朋友 我不知道哪儿它从哪里来, 这个错误是在评论区, 电子邮件的用户是谁发表评论,我认为, 在网站上,一边发表评论,这个错误也是显示

我可以删除代码吗?

的代码是在这里:

<code> 

/** * 验证电子邮件是否有效。 * *不支持i18n域名。不符合RFC。 * * @since 0.71 * * @param string $ email验证的电子邮件地址。 * @param bool $ deprecated已弃用。 * @return string | bool无效或有效的电子邮件地址。 */ 功能is_email($电子邮件,$过时= FALSE){ 如果 _deprecated_argument(FUNCTION, '3.0')(空($不建议使用)!);

// Test for the minimum length the email can be 
if (strlen($email) < 3) { 
    /** 
    * Filter whether an email address is valid. 
    * 
    * This filter is evaluated under several different contexts, such as 'email_too_short', 
    * 'email_no_at', 'local_invalid_chars', 'domain_period_sequence', 'domain_period_limits', 
    * 'domain_no_periods', 'sub_hyphen_limits', 'sub_invalid_chars', or no specific context. 
</code> 
相关问题