From 41636d92cf504374727d90bdd0377ef6c624494a Mon Sep 17 00:00:00 2001 From: Instrye Date: Fri, 29 Nov 2019 17:02:31 +0800 Subject: [PATCH] fix safe_mailto multi-byte safe --- system/Helpers/url_helper.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/system/Helpers/url_helper.php b/system/Helpers/url_helper.php index a392f01772df..20f1f471977e 100644 --- a/system/Helpers/url_helper.php +++ b/system/Helpers/url_helper.php @@ -422,9 +422,9 @@ function safe_mailto(string $email, string $title = '', $attributes = ''): strin } else { - for ($i = 0, $l = strlen($attributes); $i < $l; $i ++) + for ($i = 0, $l = mb_strlen($attributes); $i < $l; $i ++) { - $x[] = $attributes[$i]; + $x[] = mb_substr($attributes, $i, 1); } } }