From 0a8df03fe343b38077b1c8452f269982cadfbe9b Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Sun, 9 Jun 2019 22:23:21 +0200 Subject: [PATCH] mark old utf8 functions deprecated Actually replacing all calls is still to come. --- inc/utf8.php | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/inc/utf8.php b/inc/utf8.php index 03e4a4d3b..f645c7acd 100644 --- a/inc/utf8.php +++ b/inc/utf8.php @@ -49,184 +49,236 @@ if (UTF8_MBSTRING) { if (!function_exists('utf8_isASCII')) { + /** @deprecated 2019-06-09 */ function utf8_isASCII($str) { + dbg_deprecated(Clean::class . '::isASCII()'); return Clean::isASCII($str); } } if (!function_exists('utf8_strip')) { + /** @deprecated 2019-06-09 */ function utf8_strip($str) { + dbg_deprecated(Clean::class . '::strip()'); return Clean::strip($str); } } if (!function_exists('utf8_check')) { + /** @deprecated 2019-06-09 */ function utf8_check($str) { + dbg_deprecated(Clean::class . '::isUtf8()'); return Clean::isUtf8($str); } } if (!function_exists('utf8_basename')) { + /** @deprecated 2019-06-09 */ function utf8_basename($path, $suffix = '') { + dbg_deprecated(PhpString::class . '::basename()'); return PhpString::basename($path, $suffix); } } if (!function_exists('utf8_strlen')) { + /** @deprecated 2019-06-09 */ function utf8_strlen($str) { + dbg_deprecated(PhpString::class . '::strlen()'); return PhpString::strlen($str); } } if (!function_exists('utf8_substr')) { + /** @deprecated 2019-06-09 */ function utf8_substr($str, $offset, $length = null) { + dbg_deprecated(PhpString::class . '::substr()'); return PhpString::substr($str, $offset, $length); } } if (!function_exists('utf8_substr_replace')) { + /** @deprecated 2019-06-09 */ function utf8_substr_replace($string, $replacement, $start, $length = 0) { + dbg_deprecated(PhpString::class . '::substr_replace()'); return PhpString::substr_replace($string, $replacement, $start, $length); } } if (!function_exists('utf8_ltrim')) { + /** @deprecated 2019-06-09 */ function utf8_ltrim($str, $charlist = '') { + dbg_deprecated(PhpString::class . '::ltrim()'); return PhpString::ltrim($str, $charlist); } } if (!function_exists('utf8_rtrim')) { + /** @deprecated 2019-06-09 */ function utf8_rtrim($str, $charlist = '') { + dbg_deprecated(PhpString::class . '::rtrim()'); return PhpString::rtrim($str, $charlist); } } if (!function_exists('utf8_trim')) { + /** @deprecated 2019-06-09 */ function utf8_trim($str, $charlist = '') { + dbg_deprecated(PhpString::class . '::trim()'); return PhpString::trim($str, $charlist); } } if (!function_exists('utf8_strtolower')) { + /** @deprecated 2019-06-09 */ function utf8_strtolower($str) { + dbg_deprecated(PhpString::class . '::strtolower()'); return PhpString::strtolower($str); } } if (!function_exists('utf8_strtoupper')) { + /** @deprecated 2019-06-09 */ function utf8_strtoupper($str) { + dbg_deprecated(PhpString::class . '::strtoupper()'); return PhpString::strtoupper($str); } } if (!function_exists('utf8_ucfirst')) { + /** @deprecated 2019-06-09 */ function utf8_ucfirst($str) { + dbg_deprecated(PhpString::class . '::ucfirst()'); return PhpString::ucfirst($str); } } if (!function_exists('utf8_ucwords')) { + /** @deprecated 2019-06-09 */ function utf8_ucwords($str) { + dbg_deprecated(PhpString::class . '::ucwords()'); return PhpString::ucwords($str); } } if (!function_exists('utf8_deaccent')) { + /** @deprecated 2019-06-09 */ function utf8_deaccent($str, $case = 0) { + dbg_deprecated(Clean::class . '::deaccent()'); return Clean::deaccent($str, $case); } } if (!function_exists('utf8_romanize')) { + /** @deprecated 2019-06-09 */ function utf8_romanize($str) { + dbg_deprecated(Clean::class . '::romanize()'); return Clean::romanize($str); } } if (!function_exists('utf8_stripspecials')) { + /** @deprecated 2019-06-09 */ function utf8_stripspecials($str, $repl = '', $additional = '') { + dbg_deprecated(Clean::class . '::stripspecials()'); return Clean::stripspecials($str, $repl, $additional); } } if (!function_exists('utf8_strpos')) { + /** @deprecated 2019-06-09 */ function utf8_strpos($haystack, $needle, $offset = 0) { + dbg_deprecated(PhpString::class . '::strpos()'); return PhpString::strpos($haystack, $needle, $offset); } } if (!function_exists('utf8_tohtml')) { + /** @deprecated 2019-06-09 */ function utf8_tohtml($str) { + dbg_deprecated(Conversion::class . '::toHtml()'); return Conversion::toHtml($str); } } if (!function_exists('utf8_unhtml')) { + /** @deprecated 2019-06-09 */ function utf8_unhtml($str, $enties = false) { + dbg_deprecated(Conversion::class . '::fromHtml()'); return Conversion::fromHtml($str, $enties); } } if (!function_exists('utf8_to_unicode')) { + /** @deprecated 2019-06-09 */ function utf8_to_unicode($str, $strict = false) { + dbg_deprecated(Conversion::class . '::fromUtf8()'); return Unicode::fromUtf8($str, $strict); } } if (!function_exists('unicode_to_utf8')) { + /** @deprecated 2019-06-09 */ function unicode_to_utf8($arr, $strict = false) { + dbg_deprecated(Conversion::class . '::toUtf8()'); return Unicode::toUtf8($arr, $strict); } } if (!function_exists('utf8_to_utf16be')) { + /** @deprecated 2019-06-09 */ function utf8_to_utf16be($str, $bom = false) { + dbg_deprecated(Conversion::class . '::toUtf16be()'); return Conversion::toUtf16be($str, $bom); } } if (!function_exists('utf16be_to_utf8')) { + /** @deprecated 2019-06-09 */ function utf16be_to_utf8($str) { + dbg_deprecated(Conversion::class . '::fromUtf16be()'); return Conversion::fromUtf16be($str); } } if (!function_exists('utf8_bad_replace')) { + /** @deprecated 2019-06-09 */ function utf8_bad_replace($str, $replace = '') { + dbg_deprecated(Clean::class . '::replaceBadBytes()'); return Clean::replaceBadBytes($str, $replace); } } if (!function_exists('utf8_correctIdx')) { + /** @deprecated 2019-06-09 */ function utf8_correctIdx($str, $i, $next = false) { + dbg_deprecated(Clean::class . '::correctIdx()'); return Clean::correctIdx($str, $i, $next); } } -- 2.11.4.GIT