กรุณาปิด โปรแกรมบล๊อกโฆษณา เพราะเราอยู่ได้ด้วยโฆษณาที่ท่านเห็น
Please close the adblock program. Because we can live with the ads you see


วิธีการทํา Unmarked url for xf 2.1.x fixed unicode (no addon)

  • เริ่มกระทู้โดย เริ่มกระทู้โดย thxf.org
  • วันที่เริ่มกระทู้ วันที่เริ่มกระทู้

thxf.org

Staff Member
Adminstrator
Moderater
VIP Member
Registered
The URL does not signify that you should edit the addon so you don't need to do anything (personal experience).
This code I have added some unicode characters when the member using unicode combination will fail to delete the

Find Router file. php in / src / XF / Mvc directory

Find the code
PHP:
if ($romanize)
        {
            $string = utf8_romanize(utf8_deaccent($string));
            $originalString = $string;

            // Attempt to transliterate remaining UTF-8 characters to their ASCII equivalents
            $string = @iconv('UTF-8', 'ASCII//TRANSLIT', $string);
            if (!$string)
            {
                // iconv failed so forget about it
                $string = $originalString;
            }
        }

add below
PHP:
$aPattern = array (
            "a" => "á|à|ạ|ả|ã|ă|ắ|ằ|ặ|ẳ|ẵ|â|ấ|ầ|ậ|ẩ|ẫ|Á|À|Ạ|Ả|Ã|Ă|Ắ|Ằ|Ặ|Ẳ|Ẵ|Â|Ấ|Ầ|Ậ|Ẩ|Ẫ",
            "o" => "ó|ò|ọ|ỏ|õ|ô|ố|ồ|ộ|ổ|ỗ|ơ|ớ|ờ|ợ|ở|ỡ|Ó|Ò|Ọ|Ỏ|Õ|Ô|Ố|Ồ|Ộ|Ổ|Ỗ|Ơ|Ớ|Ờ|Ợ|Ở|Ỡ",
            "e" => "é|è|ẹ|ẻ|ẽ|ê|ế|ề|ệ|ể|ễ|É|È|Ẹ|Ẻ|Ẽ|Ê|Ế|Ề|Ệ|Ể|Ễ",
            "u" => "ú|ù|ụ|ủ|ũ|ư|ứ|ừ|ự|ử|ữ|Ú|Ù|Ụ|Ủ|Ũ|Ư|Ứ|Ừ|Ự|Ử|Ữ",
            "i" => "í|ì|ị|ỉ|ĩ|Í|Ì|Ị|Ỉ|Ĩ",
            "y" => "ý|ỳ|ỵ|ỷ|ỹ|Ý|Ỳ|Ỵ|Ỷ|Ỹ",
            "d" => "đ|Đ",
            "" => "̉|̣|̃|̀|́", // dấu unicode tổ hợp
        );
        while(list($key,$value) = each($aPattern))
        {
            $string = preg_replace('/'.$value.'/i', $key, $string);
        }
Note in the admincp it will tell the file to be changed, don't worry about it
 



กรุณาปิด โปรแกรมบล๊อกโฆษณา เพราะเราอยู่ได้ด้วยโฆษณาที่ท่านเห็น
Please close the adblock program. Because we can live with the ads you see
ด้านบน ด้านล่าง