Index: trunk/phase3/includes/GlobalFunctions.php |
— | — | @@ -61,6 +61,13 @@ |
62 | 62 | } |
63 | 63 | } |
64 | 64 | |
| 65 | +if ( !function_exists( 'mb_strlen' ) ) { |
| 66 | + function mb_strlen( $str, $enc = "" ) { |
| 67 | + preg_match_all( '/./us', $str, $matches ); |
| 68 | + return count($matches); |
| 69 | + } |
| 70 | +} |
| 71 | + |
65 | 72 | if ( !function_exists( 'array_diff_key' ) ) { |
66 | 73 | /** |
67 | 74 | * Exists in PHP 5.1.0+ |
Index: trunk/phase3/includes/Revision.php |
— | — | @@ -307,7 +307,7 @@ |
308 | 308 | $this->mTitle = null; # Load on demand if needed |
309 | 309 | $this->mCurrent = false; |
310 | 310 | |
311 | | - $this->mSize = is_null($this->mText) ? null : strlen($this->mText); |
| 311 | + $this->mSize = is_null($this->mText) ? null : mb_strlen($this->mText); |
312 | 312 | } else { |
313 | 313 | throw new MWException( 'Revision constructor passed invalid row format.' ); |
314 | 314 | } |
— | — | @@ -692,7 +692,7 @@ |
693 | 693 | 'rev_user_text' => $this->mUserText, |
694 | 694 | 'rev_timestamp' => $dbw->timestamp( $this->mTimestamp ), |
695 | 695 | 'rev_deleted' => $this->mDeleted, |
696 | | - 'rev_len' => strlen($this->mText), |
| 696 | + 'rev_len' => mb_strlen($this->mText), |
697 | 697 | ), $fname |
698 | 698 | ); |
699 | 699 | |