WordPress.org

Ready to get started?Download WordPress

Forums

Responsive Select Menu
Problem with cyrillic letters (3 posts)

  1. Sami Keijonen
    WordPress-asiantuntija
    Posted 9 months ago #

    Hi.

    When using cyrillic letters letters (like in russia) in page name I get this warning and naturally select menu doesn't work.

    Warning: sprintf() [function.sprintf]: Too few arguments in /wp-includes/nav-menu-template.php on line 246

    Any ideas to fix this? When changing to page slug something that is not cyrillic letters seems to work but is there any other way.

    http://wordpress.org/plugins/responsive-select-menu/

  2. sevenspark
    Member
    Plugin Author

    Posted 8 months ago #

    Hi Sami,

    Thanks for the info. I've investigated this and found that the issue is that the cyrillic characters are escaped in the URL, leaving strings like %d. This is then interpreted by sprintf as an argument, and the function throws an error.

    Here's a potential solution: in responsive-select-menu.php, find line 551, which should look like this:

    $attributes = ' value="' . esc_attr( $item->url ) .'"';

    Add this line before it:

    $item->url = urldecode( $item->url );

    This will unescape the values and should allow the menu to render properly. The only question is whether this will cause other issues by having non-escaped characters in your URLs

    Hope that helps!

    Chris

  3. moldero
    Member
    Posted 3 months ago #

    couldn't find
    $attributes = ' value="' . esc_attr( $item->url ) .'"';
    in responsive-select-menu.php, i have a newer version perhaps?

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.