Skip to main content

Use mb_strlen for compatibility with cyrillic

ClassiBase classifieds script Forums Suggestions Use mb_strlen for compatibility with cyrillic

Tagged: ,

This topic contains 1 reply, has 2 voices, and was last updated by  ClassiBase 3 weeks ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #7138 Reply

    Dmitry Grunt
    Participant

    Had issue with site title in cyrillic, counting title length seems doesn’t work with default strlen function. I replaced strlen by mb_strlen and all works fine.

    Maybe you guys can fix such bugs in backend, to make script more compatible with non latin characters? All multilanguage users will be happy.

    PATH: \sys\app\controllers\IndexController.php
    // set title
    $title = $ad->title;
    if (mb_strlen($title) < 50)
    {
    // add location and site name
    if ($ad->Location)
    {
    $title .= ‘ – ‘ . Location::getName($ad->Location);
    }
    if (mb_strlen($title) < 50)
    {
    // add site name
    $title .= ‘ – ‘ . Config::option(‘site_title’);
    }
    }

    • This topic was modified 3 weeks, 1 day ago by  Dmitry Grunt.
    #7147 Reply

    ClassiBase
    Keymaster

    We didn’t use it to make script compatible with default PHP installations. MB functions are not enabled by default http://www.php.net/manual/en/mbstring.installation.php

    mbstring is a non-default extension. This means it is not enabled by default. You must explicitly enable the module with the configure option.

    Also we didn’t want to check if function is available before using it.

Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: Use mb_strlen for compatibility with cyrillic
Your information:




  • Classifieds Business Newsletter

    Get discounts and tips about growing your classifieds website.

    Subscribe