Opened 15 years ago
Closed 14 years ago
#14882 closed defect (bug) (fixed)
streams.php, POMO_FileReader, binary read fopen, Windows
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 3.3 | Priority: | low |
| Severity: | normal | Version: | 3.0.1 |
| Component: | General | Keywords: | has-patch commit windows 3.3-early |
| Focuses: | Cc: |
Description
My system is :
Windows
PHP 4.3.0
Mysql 4.1
Minimal requiem for Wordpress.
In file: wp-includes/pomo/streams.php
Class: POMO_FileReader
Code:
function POMO_FileReader($filename) {
parent::POMO_Reader();
$this->_f = fopen($filename, 'r');
}
BUG (from PHP.net):
On systems which differentiate between binary and text files (i.e. Windows) the file must be opened with 'b' included in fopen() mode parameter.
FIX:
function POMO_FileReader($filename) {
parent::POMO_Reader();
$this->_f = fopen($filename, 'rb');
}
If you don't set 'rb' parametr in fopen languages files like mo are not loaded into system. Becouse incorrect read length
CLASS: POMO_Reader
function strlen($string) {
if ($this->is_overloaded) {
return mb_strlen($string, 'ascii');
} else {
return strlen($string);
}
}
And script stop on this line :
FILE: mo.php
$originals = $reader->read($originals_lengths_length);
if ( $reader->strlen( $originals ) != $originals_lengths_length )
return false;
--
cr00nad@…
Attachments (1)
Change History (9)
#2
@
15 years ago
The change seems harmless, passes all tests, and was committed in http://trac.glotpress.org/changeset/597
#4
@
15 years ago
- Keywords commit windows added
- Milestone changed from Awaiting Review to 3.1
- Owner set to nbachiyski
- Priority changed from normal to low
- Status changed from new to assigned
Feedback seems reasonable to me. Maybe this is already fixed upstream in Pear?