1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-11 17:14:42 +02:00

Issue #5443 Replaced with non-deprecated counterparts and made sure deprecated items are displayed after running unit tests.

This commit is contained in:
camer0n
2025-04-22 17:44:17 -07:00
parent a4d59dba0c
commit a9d20d8e93
12 changed files with 218 additions and 66 deletions

View File

@@ -318,7 +318,7 @@ class e_parse
* NOTE: can't be called until CHARSET is known
* but we all know that it is UTF-8 now
*
* @return void
* @return void|null
*/
public function setMultibyte($bool)
{
@@ -1895,7 +1895,7 @@ class e_parse
}
elseif (is_string($mixed))
{
return iconv('UTF-8', 'UTF-8//IGNORE', utf8_encode($mixed));
return iconv('UTF-8', 'UTF-8//IGNORE', mb_convert_encoding($mixed, 'UTF-8', 'ISO-8859-1'));
}
return $mixed;
@@ -2316,7 +2316,7 @@ class e_parse
/**
* Retrieve img tag width and height attributes for current thumbnail.
*
* @return string
* @return string|null
*/
public function thumbDimensions($type = 'single')
{
@@ -2385,7 +2385,7 @@ class e_parse
*
* @param string $path The file path of the image whose alternate text is being cached.
* @param string $value The alternate text value to cache.
* @return string or false on failure
* @return string|false String or false on failure
*/
public function setImageAltCacheFile($path, $value)
{
@@ -3343,7 +3343,7 @@ class e_parse
$replace = ((string) $mode === 'full' || (string) $mode === 'abs') ? $replace_absolute : $replace_relative;
return str_replace($search, $replace, $text);
return !empty($text) ? str_replace($search, $replace, $text) : $text;
}
// $pattern = ($all ? "#\{([A-Za-z_0-9]*)\}#s" : "#\{(e_[A-Z]*)\}#s");
@@ -4670,8 +4670,9 @@ class e_parse
* 'legacy' => (array) Usually a legacy path like {e_FILE}
* 'type' => (array) Force the returned image to be a jpg, webp etc.
* ]
* @return string
*
* @example $tp->toImage('welcome.png', array('legacy'=>{e_IMAGE}newspost_images/','w'=>200));
* @return string|null
*/
public function toImage($file, $parm = array())
{
@@ -5250,7 +5251,7 @@ class e_parse
*
* @param integer $datestamp - unix timestamp
* @param string $format - short | long | relative
* @return string converted date (html)
* @return string|null converted date (html)
*/
public function toDate($datestamp = null, $format = 'short')
{
@@ -5500,11 +5501,7 @@ class e_parse
// Set it up for processing.
libxml_use_internal_errors(true);
if (function_exists('mb_convert_encoding'))
{
$html = mb_convert_encoding($html, 'HTML-ENTITIES', 'UTF-8');
}
$html = mb_encode_numericentity($html, [0x80, 0xffff, 0, 0xffff], 'UTF-8');
// $fragment = $doc->createDocumentFragment();
// $fragment->appendXML($html);