- FTP:
. Fixed bug #55857 (ftp_size on large files). (cmb)
+- Mbstring:
+ . Fixed bug #79787 (mb_strimwidth does not trim string). (XXiang)
+
- Standard:
. Fixed bug #70362 (Can't copy() large 'data://' with open_basedir). (cmb)
mbfl_convert_filter_flush(encoder);
if (pc.status != 0 && mkwidth > 0) {
pc.width += mkwidth;
- while (n > 0) {
- if ((*encoder->filter_function)(*p++, encoder) < 0) {
- break;
+ if (n > 0) {
+ while (n > 0) {
+ if ((*encoder->filter_function)(*p++, encoder) < 0) {
+ break;
+ }
+ n--;
}
- n--;
+ mbfl_convert_filter_flush(encoder);
+ } else if (pc.outwidth > pc.width) {
+ pc.status++;
}
- mbfl_convert_filter_flush(encoder);
if (pc.status != 1) {
pc.status = 10;
pc.device.pos = pc.endpos;
--- /dev/null
+--TEST--
+Bug #79787 mb_strimwidth does not trim string
+--SKIPIF--
+<?php extension_loaded('mbstring') or die('skip mbstring not available'); ?>
+--FILE--
+<?php
+echo mb_strimwidth("一二三", 0, 4, '.', 'UTF-8')."\n";
+echo mb_strimwidth("一二三", 0, 5, '.', 'UTF-8')."\n";
+echo mb_strimwidth("一二三", 0, 6, '.', 'UTF-8')."\n";
+echo mb_strimwidth("abcdef", 0, 4, '.', 'UTF-8')."\n";
+echo mb_strimwidth("abcdef", 0, 5, '.', 'UTF-8')."\n";
+echo mb_strimwidth("abcdef", 0, 6, '.', 'UTF-8')."\n";
+?>
+--EXPECT--
+一.
+一二.
+一二三
+abc.
+abcd.
+abcdef