Skip to content

Commit 3a4c839

Browse files
authored
Merge pull request #19 from troosan/un-deprecate_is_utf8
restore the isUTF8 method
2 parents 5d35fcf + ed83841 commit 3a4c839

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/Common/Text.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public static function controlCharacterPHP2OOXML($value = '')
6464

6565
return str_replace(array_values(self::$controlCharacters), array_keys(self::$controlCharacters), $value);
6666
}
67-
67+
6868
/**
6969
* Return a number formatted for being integrated in xml files
7070
* @param float $number
@@ -74,7 +74,7 @@ public static function numberFormat($number, $decimals)
7474
{
7575
return number_format($number, $decimals, '.', '');
7676
}
77-
77+
7878
/**
7979
* @param int $dec
8080
* @link http://stackoverflow.com/a/7153133/2235790
@@ -115,14 +115,12 @@ public static function controlCharacterOOXML2PHP($value = '')
115115
/**
116116
* Check if a string contains UTF-8 data
117117
*
118-
* @deprecated 0.2.4 Use `Zend\Stdlib\StringUtils::isValidUtf8` instead.
119-
*
120118
* @param string $value
121119
* @return boolean
122120
*/
123121
public static function isUTF8($value = '')
124122
{
125-
return $value === '' || preg_match('/^./su', $value) === 1;
123+
return is_string($value) && ($value === '' || preg_match('/^./su', $value) == 1);
126124
}
127125

128126
/**

0 commit comments

Comments
 (0)