警告sprintf()function.sprintf参数太少

时间:2014-12-14 11:37:20

标签: php wordpress

我有一个WordPress脚本,但当网址包含非拉丁字符时,菜单会消失。示例:www.site.com/بحث

我得到:

warning sprintf() function.sprintf too few arguments in nav-menu-template.php

在这一行:

$nav_menu .= sprintf( $args->items_wrap, esc_attr( $wrap_id ), esc_attr( $wrap_class ), $items );

1 个答案:

答案 0 :(得分:1)

如果您的网址中包含阿拉伯字符,有时会出现问题。

http://istizada.com/understanding-arabic-url-uri-structure-encoding-for-arabic-sites/

这是一个很酷的帖子,当你有这样的URL时会发生什么。

但通常这个错误意味着你有更多占位符作为要替换的字符串。我想当你的URL中有这样的字符时,它会转换为UTF-8 URL编码。

%D9%86 = ن

然后你有这样的东西,当你直接把它放到你的sprintf时,你会有一些新的占位符和这样的错误。

尝试使用rawurldecode更改该字符。

http://php.net/manual/de/function.rawurldecode.php

相关问题