Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit232fc09

Browse files
committed
Add method on InputStream to get all chars to EOF (this will allow us to re-optimize PLAINTEXT). Also we want to check that iconv extension is loaded, not that there is a function of that name.
1 parent8e6d677 commit232fc09

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

‎library/HTML5/InputStream.php

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public function __construct($data) {
7171
// We previously had an mbstring implementation here, but that
7272
// implementation is heavily non-conforming, so it's been
7373
// omitted.
74-
if (function_exists('iconv')) {
74+
if (extension_loaded('iconv')) {
7575
// non-conforming
7676
$data =iconv('UTF-8','UTF-8//IGNORE',$data);
7777
}else {
@@ -220,18 +220,14 @@ public function char() {
220220
}
221221

222222
/**
223-
*Return some range of characters.
223+
*Get all characters until EOF.
224224
* @note This performs bounds checking
225-
* @param $l Length
226225
*/
227-
publicfunctionchars($l =1) {
228-
if((int)$l >0 &&$this->char <$this->EOF) {
229-
$this->char +=$l;
230-
if($l ===1) {
231-
return$this->data[$this->char];
232-
}else {
233-
returnsubstr($this->data,$this->char,$l);
234-
}
226+
publicfunctionremainingChars() {
227+
if($this->char <$this->EOF) {
228+
$data =substr($this->data,$this->char);
229+
$this->char =$this->EOF;
230+
return$data;
235231
}else {
236232
returnfalse;
237233
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp