1<?php 2/** 3 * @package Joomla.Platform 4 * @subpackage String 5 * 6 * @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All rights reserved. 7 * @license GNU General Public License version 2 or later; see LICENSE 8 */ 9 10defined('JPATH_PLATFORM') or die; 11 12JLoader::register('idna_convert', JPATH_LIBRARIES . '/idna_convert/idna_convert.class.php'); 13 14/** 15 * Wrapper class for JStringPunycode 16 * 17 * @package Joomla.Platform 18 * @subpackage String 19 * @since 3.4 20 * @deprecated 4.0 Will be removed without replacement 21 */ 22class JStringWrapperPunycode 23{ 24 /** 25 * Helper wrapper method for toPunycode 26 * 27 * @param string $utfString The UTF-8 string to transform. 28 * 29 * @return string The punycode string. 30 * 31 * @see JUserHelper::toPunycode() 32 * @since 3.4 33 */ 34 public function toPunycode($utfString) 35 { 36 return JStringPunycode::toPunycode($utfString); 37 } 38 39 /** 40 * Helper wrapper method for fromPunycode 41 * 42 * @param string $punycodeString The Punycode string to transform. 43 * 44 * @return string The UF-8 URL. 45 * 46 * @see JUserHelper::fromPunycode() 47 * @since 3.4 48 */ 49 public function fromPunycode($punycodeString) 50 { 51 return JStringPunycode::fromPunycode($punycodeString); 52 } 53 54 /** 55 * Helper wrapper method for urlToPunycode 56 * 57 * @param string $uri The UTF-8 URL to transform. 58 * 59 * @return string The punycode URL. 60 * 61 * @see JUserHelper::urlToPunycode() 62 * @since 3.4 63 */ 64 public function urlToPunycode($uri) 65 { 66 return JStringPunycode::urlToPunycode($uri); 67 } 68 69 /** 70 * Helper wrapper method for urlToUTF8 71 * 72 * @param string $uri The Punycode URL to transform. 73 * 74 * @return string The UTF-8 URL. 75 * 76 * @see JStringPunycode::urlToUTF8() 77 * @since 3.4 78 */ 79 public function urlToUTF8($uri) 80 { 81 return JStringPunycode::urlToUTF8($uri); 82 } 83 84 /** 85 * Helper wrapper method for emailToPunycode 86 * 87 * @param string $email The UTF-8 email to transform. 88 * 89 * @return string The punycode email. 90 * 91 * @see JStringPunycode::emailToPunycode() 92 * @since 3.4 93 */ 94 public function emailToPunycode($email) 95 { 96 return JStringPunycode::emailToPunycode($email); 97 } 98 99 /** 100 * Helper wrapper method for emailToUTF8 101 * 102 * @param string $email The punycode email to transform. 103 * 104 * @return string The punycode email. 105 * 106 * @see JStringPunycode::emailToUTF8() 107 * @since 3.4 108 */ 109 public function emailToUTF8($email) 110 { 111 return JStringPunycode::emailToUTF8($email); 112 } 113} 114