Fix #81032: GD install is affected by external libgd installation

This PR replaces the bundled libgd includes from #include <foo.h> with
#include "foo.h" for gd-related headers to avoid including headers that
may be available in system directories instead of the expected local
headers.

Closes GH-6975.
This commit is contained in:
Flavio Heleno 2021-05-12 13:36:43 +02:00 committed by Christoph M. Becker
parent f6c15e2caf
commit 28e7addb9d
No known key found for this signature in database
GPG key ID: D66C9593118BCCB6
5 changed files with 27 additions and 12 deletions

4
NEWS
View file

@ -18,6 +18,10 @@ PHP NEWS
. Fixed bug #80901 (Info leak in ftp extension). (cmb) . Fixed bug #80901 (Info leak in ftp extension). (cmb)
. Fixed bug #79100 (Wrong FTP error messages). (cmb) . Fixed bug #79100 (Wrong FTP error messages). (cmb)
- GD:
. Fixed bug #81032 (GD install is affected by external libgd installation).
(Flavio Heleno, cmb)
- MBString: - MBString:
. Fixed bug #81011 (mb_convert_encoding removes references from arrays). (cmb) . Fixed bug #81011 (mb_convert_encoding removes references from arrays). (cmb)

View file

@ -60,13 +60,23 @@
static int le_gd, le_gd_font; static int le_gd, le_gd_font;
#include <gd.h> #ifdef HAVE_GD_BUNDLED
#include <gd_errors.h> # include "libgd/gd.h"
#include <gdfontt.h> /* 1 Tiny font */ # include "libgd/gd_errors.h"
#include <gdfonts.h> /* 2 Small font */ # include "libgd/gdfontt.h" /* 1 Tiny font */
#include <gdfontmb.h> /* 3 Medium bold font */ # include "libgd/gdfonts.h" /* 2 Small font */
#include <gdfontl.h> /* 4 Large font */ # include "libgd/gdfontmb.h" /* 3 Medium bold font */
#include <gdfontg.h> /* 5 Giant font */ # include "libgd/gdfontl.h" /* 4 Large font */
# include "libgd/gdfontg.h" /* 5 Giant font */
#else
# include <gd.h>
# include <gd_errors.h>
# include <gdfontt.h> /* 1 Tiny font */
# include <gdfonts.h> /* 2 Small font */
# include <gdfontmb.h> /* 3 Medium bold font */
# include <gdfontl.h> /* 4 Large font */
# include <gdfontg.h> /* 5 Giant font */
#endif
#if defined(HAVE_GD_FREETYPE) && defined(HAVE_GD_BUNDLED) #if defined(HAVE_GD_FREETYPE) && defined(HAVE_GD_BUNDLED)
# include <ft2build.h> # include <ft2build.h>

View file

@ -19,11 +19,12 @@
* (end code) * (end code)
**/ **/
#include <gd.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <math.h> #include <math.h>
#include "gd.h"
static int gdGuessBackgroundColorFromCorners(gdImagePtr im, int *color); static int gdGuessBackgroundColorFromCorners(gdImagePtr im, int *color);
static int gdColorMatch(gdImagePtr im, int col1, int col2, float threshold); static int gdColorMatch(gdImagePtr im, int col1, int col2, float threshold);

View file

@ -58,7 +58,7 @@ TODO:
#include <string.h> #include <string.h>
#include <math.h> #include <math.h>
#include <gd.h> #include "gd.h"
#include "gdhelpers.h" #include "gdhelpers.h"
#ifdef _MSC_VER #ifdef _MSC_VER

View file

@ -51,13 +51,13 @@
---------------------------------------------------------------------------- ----------------------------------------------------------------------------
*/ */
#include <gd.h>
#include <gdfonts.h>
#include <gd_errors.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <limits.h> #include <limits.h>
#include "gd.h"
#include "gdfonts.h"
#include "gd_errors.h"
#include "wbmp.h" #include "wbmp.h"