dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ParsoidVirtualRESTService: Don't use "else if"
[lhc/web/wiklou.git]
/
includes
/
libs
/
normal
/
UtfNormalUtil.php
diff --git
a/includes/libs/normal/UtfNormalUtil.php
b/includes/libs/normal/UtfNormalUtil.php
index
6c925df
..
ae88e73
100644
(file)
--- a/
includes/libs/normal/UtfNormalUtil.php
+++ b/
includes/libs/normal/UtfNormalUtil.php
@@
-27,10
+27,10
@@
/**
* Return UTF-8 sequence for a given Unicode code point.
/**
* Return UTF-8 sequence for a given Unicode code point.
- * May die if fed out of range data.
*
* @param $codepoint Integer:
* @return String
*
* @param $codepoint Integer:
* @return String
+ * @throws InvalidArgumentException if fed out of range data.
* @public
*/
function codepointToUtf8( $codepoint ) {
* @public
*/
function codepointToUtf8( $codepoint ) {
@@
-56,8
+56,7
@@
function codepointToUtf8( $codepoint ) {
chr( $codepoint & 0x3f | 0x80 );
}
chr( $codepoint & 0x3f | 0x80 );
}
- echo "Asked for code outside of range ($codepoint)\n";
- die( -1 );
+ throw new InvalidArgumentException( "Asked for code outside of range ($codepoint)" );
}
/**
}
/**
@@
-67,6
+66,7
@@
function codepointToUtf8( $codepoint ) {
*
* @param $sequence String
* @return String
*
* @param $sequence String
* @return String
+ * @throws InvalidArgumentException if fed out of range data.
* @private
*/
function hexSequenceToUtf8( $sequence ) {
* @private
*/
function hexSequenceToUtf8( $sequence ) {