Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Tagging does not work with other languages tags (eg greek or russian)

edited February 2011 in Vanilla 2.0 - 2.8
discussions/tagged&Tag=Δοκιμή
Clicking on tag "Δοκιμή" displays an empty result because it does not recognise the encoding

(message displayed is Questions tagged with '')

Comments

  • I think this problem is similar with this : http://vanillaforums.org/discussion/12703/utf-8-tagging

    which haven't been solved.
    Even in Issue tracker it has no comments...
    Thanks
  • edited February 2011
    The problem is caused from the Tagging plug-in
    1. class.tagging.plugin.php uses strtolower which does not support UTF-8 so your Unicode data are not stored in the database.
    A solution to problem(1) is to use mb_strtolower() (which handles Unicode but is slower) :
    replace :
    $FormTags = trim(strtolower(GetValue('Tags', $FormPostValues, ''))); //ORIGINAL line 148

    with

    $FormTags = trim(mb_strtolower(GetValue('Tags', $FormPostValues, ''), 'UTF-8')); //mod by trister

    and

    'Name' => strtolower($NewTag), // ORIGINAL line 166 (I Think)

    with

    'Name' => mb_strtolower($NewTag, 'UTF-8'), //mod

    2. The second problem is the URL creation of the PopularTag module (class.tagmodule.php) and is cause by this statement
    if (urlencode($Tag->Name) == $Tag->Name) .
    My modification (don't know if it causes any problem -I don't have any problem so far) actually disables this if statement :
    replace line 61

    echo Anchor(htmlspecialchars($Tag->Name), 'discussions/tagged?Tag='.urlencode($Tag->Name)); //ORIG line

    with

    echo Anchor(htmlspecialchars($Tag->Name), 'discussions/tagged/'.urlencode($Tag->Name));// mod

    Tags should now be working...
    If you encounter any problem please post it here. If I find it works ok I'll make a modified Tagging plug-in and post it here.
Sign In or Register to comment.