php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #48214 mb_substr() or mb_convert_encoding() not working
Submitted: 2009-05-09 20:51 UTC Modified: 2009-05-17 01:00 UTC
Votes:7
Avg. Score:4.6 ± 0.7
Reproduced:4 of 4 (100.0%)
Same Version:1 (25.0%)
Same OS:2 (50.0%)
From: b at ssel dot me Assigned:
Status: No Feedback Package: mbstring related
PHP Version: 5.2.9 OS: CENTOS 4.7 i686
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: b at ssel dot me
New email:
PHP Version: OS:

 

 [2009-05-09 20:51 UTC] b at ssel dot me
Description:
------------
for some reason when using mb_substr or mb_convert_encoding php page dies without any error even when error reporting is set to 
error_reporting(E_ALL);

that will happen only if we changed php.ini settings to:

upload_max_filesize: 10M
post_max_size: 10M
max_execution_time:120
max_input_time: -1

I don't think those settings are related to mb_substr, but that what was happening on php 5.2.5 and still happening on 5.2.9

Reproduce code:
---------------
$intsub = mb_substr($intwalker[0], 0, 200);
 if ($intsub != $intwalker[0]){
  $intsub = $intsub." ......";
 }
}
$intsub = mb_convert_encoding($intsub, "utf8", "auto");


Expected result:
----------------
to see a text of the only 200 first chars of $intwalker[0]

Actual result:
--------------
nothing, just a white page no errors at all even if 

error_reporting(E_ALL);

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-05-09 20:53 UTC] jani@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc. If the script requires a 
database to demonstrate the issue, please make sure it creates 
all necessary tables, stored procedures etc.

Please avoid embedding huge scripts into the report.


 [2009-05-09 20:57 UTC] b at ssel dot me
<?php

$data = "test text goes here test text goes here test text goes here test text goes here test text goes here test text goes here test text goes here test text goes here test text goes here test text goes here ";

intsub = mb_substr($data, 0, 200);
if ($intsub != $data){
 $intsub = $intsub." ......";
}

$intsub = mb_convert_encoding($intsub, "utf8", "auto");

echo $intsub;

?>
 [2009-05-09 20:59 UTC] b at ssel dot me
Sorry the example was missing a ( $ )
$intsub = mb_substr($data, 0, 200);
 [2009-05-09 21:04 UTC] b at ssel dot me
The problem also shows on ubuntu 8.04 and php 5.2.6 and php 5.2.7
 [2009-05-17 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 27 13:01:30 2024 UTC