Skip to content

Commit 3453055

Browse files
committed
Merge branch 'master' into zend_signals
* master: Removed wrong HANDLE_UNBLOCK_INTERRUPTIONS() notes to UPGRADING Update NEWS Update NEWS Update NEWS Fix #64641: imagefilledpolygon doesn't draw horizontal line
2 parents 3842242 + 8b82323 commit 3453055

13 files changed

+104
-8
lines changed

NEWS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ PHP NEWS
1616
- GD:
1717
. Fixed bug #43475 (Thick styled lines have scrambled patterns). (cmb)
1818
. Fixed bug #53640 (XBM images require width to be multiple of 8). (cmb)
19+
. Fixed bug #64641 (imagefilledpolygon doesn't draw horizontal line). (cmb)
1920

2021
- Mbstring:
2122
. Fixed bug #72405 (mb_ereg_replace - mbc_to_code (oniguruma) -

UPGRADING

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,9 @@ PHP 7.1 UPGRADE NOTES
117117
========================================
118118
6. New Functions
119119
========================================
120+
- Core:
121+
. Added sapi_windows_cp_set(), sapi_windows_cp_get(), sapi_windows_cp_is_utf8(),
122+
sapi_windows_cp_conv() for codepage handling.
120123

121124
========================================
122125
7. New Classes and Interfaces
@@ -153,6 +156,48 @@ PHP 7.1 UPGRADE NOTES
153156
========================================
154157

155158
- Core:
159+
. Support for long and UTF-8 path;
160+
161+
If an application is UTF-8 conform, no further action is required. For
162+
applications depending on paths in non UTF-8 encodings for I/O, an explicit
163+
INI directive has to be set. The encoding INI settings check relies on the
164+
order in the core:
165+
- internal_encoding
166+
- default_charset
167+
- zend.multibyte
168+
169+
Several functions for codepage handling were itroduced:
170+
- sapi_windows_cp_set() to set the default codepage
171+
- sapi_windows_cp_get() to retrieve the current codepage
172+
- sapi_windows_cp_is_utf8()
173+
- sapi_windows_cp_conv() to convert between codepages, using iconv()
174+
compatible signature
175+
These functions are thread safe.
176+
177+
The console output codepage is adjusted depending on the encoding used in
178+
PHP. Depending on the concrete system OEM codepage, the visible output
179+
might or might be not correct. For example, in the default cmd.exe and on
180+
a system with the OEM codepage 437, outputs in codepages 1251, 1252, 1253
181+
and some others can be shown correctly when using UTF-8. On the same system,
182+
chars in codepage like 20932 probably won't be shown correctly. This refers
183+
to the particular system rules for codepage, font compatibility and the
184+
particular console program used. PHP automatically sets the console codepage
185+
according to the encoding rules from php.ini. Using alternative consoles
186+
instead of cmd.exe directly might bring better experience in some cases.
187+
188+
As a result of UTF-8 support in the streams, PHP scripts are not limited
189+
to ASCII or ANSI filenames anymore. This is supported out of the box on
190+
CLI. For for other SAPI, the documentation for the corresponding server
191+
is useful.
192+
193+
Long paths support is transparent. Paths longer than 260 bytes get
194+
automatically prefixed with \\?\. The max path length is limited to
195+
2048 bytes. Be aware, that the path segment limit (basename length) still
196+
persists.
197+
198+
The recommended way to file paths, I/O and other related topics is by
199+
utilizing UTF-8.
200+
156201
. Support for ftok()
157202

158203
- FCGI

ext/gd/libgd/gd.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2715,6 +2715,19 @@ void gdImageFilledPolygon (gdImagePtr im, gdPointPtr p, int n, int c)
27152715
maxy = p[i].y;
27162716
}
27172717
}
2718+
/* necessary special case: horizontal line */
2719+
if (n > 1 && miny == maxy) {
2720+
x1 = x2 = p[0].x;
2721+
for (i = 1; (i < n); i++) {
2722+
if (p[i].x < x1) {
2723+
x1 = p[i].x;
2724+
} else if (p[i].x > x2) {
2725+
x2 = p[i].x;
2726+
}
2727+
}
2728+
gdImageLine(im, x1, miny, x2, miny, c);
2729+
return;
2730+
}
27182731
pmaxy = maxy;
27192732
/* 2.0.16: Optimization by Ilia Chipitsine -- don't waste time offscreen */
27202733
if (miny < 0) {

ext/gd/tests/bug64641.phpt

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
--TEST--
2+
Bug #64641 (imagefilledpolygon doesn't draw horizontal line)
3+
--SKIPIF--
4+
<?php
5+
if (!extension_loaded('gd')) die("skip gd extension not available\n");
6+
?>
7+
--FILE--
8+
<?php
9+
require_once __DIR__ . '/similarity.inc';
10+
11+
$im = imagecreatetruecolor(640, 480);
12+
13+
$points = array(
14+
100, 100,
15+
100, 200,
16+
100, 300
17+
);
18+
imagefilledpolygon($im, $points, 3, 0xFFFF00);
19+
20+
$points = array(
21+
300, 200,
22+
400, 200,
23+
500, 200
24+
);
25+
imagefilledpolygon($im, $points, 3, 0xFFFF00);
26+
27+
$ex = imagecreatefrompng(__DIR__ . '/bug64641.png');
28+
if (($diss = calc_image_dissimilarity($ex, $im)) < 1e-5) {
29+
echo "IDENTICAL";
30+
} else {
31+
echo "DISSIMILARITY: $diss";
32+
}
33+
imagedestroy($ex);
34+
35+
imagedestroy($im);
36+
?>
37+
--EXPECT--
38+
IDENTICAL

ext/gd/tests/bug64641.png

1.37 KB
Loading

ext/gd/tests/imagecolorallocatealpha_basic.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,5 @@ var_dump(md5(base64_encode($imgsrc)));
2626
var_dump($corA);
2727
?>
2828
--EXPECT--
29-
string(32) "b856a0b1a15efe0f79551ebbb5651fe8"
29+
string(32) "2a6424e4cb4e1b7391dfff74bf136bde"
3030
int(842163455)

ext/gd/tests/imagefilledarc_basic.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ ob_end_clean();
2525
echo md5(base64_encode($img));
2626
?>
2727
--EXPECT--
28-
894f394c7f2e2364642ef27fea6bfc33
28+
beffeaf5231adaaff1f21a2108fb6f7e

ext/gd/tests/imagefilledarc_variation1.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ ob_end_clean();
2525
echo md5(base64_encode($img));
2626
?>
2727
--EXPECT--
28-
b77bbb8207e5adbebfcc8bd1c4074305
28+
b467492b806001c3720b3f18cfbde5b0

ext/gd/tests/imagefilledarc_variation2.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ ob_end_clean();
2525
echo md5(base64_encode($img));
2626
?>
2727
--EXPECT--
28-
b8b572812b3c85678f6c38c4ecca7619
28+
cfad369fc6d863785d3c95b4b4788225

ext/gd/tests/imagegammacorrect_basic.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ if ($gamma){
2929
echo md5(base64_encode($img));
3030
?>
3131
--EXPECT--
32-
30639772903913594bc665743e1b9ab8
32+
e79553115df689ea5df18a4636380569

ext/gd/tests/imagegammacorrect_variation1.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ if ($gamma){
2929
echo md5(base64_encode($img));
3030
?>
3131
--EXPECT--
32-
7716c0905ae08bd84b4d6cba8969a42e
32+
b017b1ddc8bda00e82aa8cbfb54c35d4

ext/gd/tests/imagetruecolortopalette_basic.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ echo md5(base64_encode($img));
2828
?>
2929
--EXPECT--
3030
bool(true)
31-
0843f63ab2f9fddedd69b0b421686bc5
31+
1d41787ff70aa0c7eea5ee9304afa36b

ext/opcache/ZendAccelerator.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2773,7 +2773,6 @@ static int accel_startup(zend_extension *extension)
27732773
zend_shared_alloc_unlock();
27742774

27752775
SHM_PROTECT();
2776-
HANDLE_UNBLOCK_INTERRUPTIONS();
27772776
#ifdef HAVE_OPCACHE_FILE_CACHE
27782777
} else if (!ZCG(accel_directives).file_cache) {
27792778
accel_startup_ok = 0;

0 commit comments

Comments
 (0)