Commit Graph

709 Commits

Author SHA1 Message Date
Peter Kokot
69b20f51e1 Disable PACKAGE_* preprocessor symbols
Autoconf defines PACKAGE_* symbols:
- PACKAGE_NAME
- PACKAGE_VERSION
- PACKAGE_TARNAME
- PACKAGE_STRING
- PACKAGE_BUGREPORT
- PACKAGE_URL

and appends them to the generated config.h.in files. With AC_INIT change
via afd52f9d99 where package version, URL,
bug report location and similar meta data are defined, these
preprocessor macros are then non empty strings in the generated
configuration header file. When using phpize, PHP shares the config
files in extensions, warnings of redefined macros appear, such as:
- `warning: 'PACKAGE_NAME' macro redefined`

This patch now disables these non utilized symbols in the generated
config header files.

Better practice would be to include only API specific headers where
needed but this would require even more refactorings. Some extensions
such as pcre, pgsql, and pdo_pgsql solve this issue by undefining some
of these symbols before including the library configuration headers in
the code also. Because these symbols can be defined by any library which
uses Autotools.

Additionally, the unused PACKAGE_* symbols were cleaned for the bundled
libmbfl library and with this patch not needed undef code removed.
2019-04-13 07:00:17 +02:00
Nikita Popov
4cfa4fb55d Don't use php_strtok_r in build_tablename
This is unnecessary convoluted... we just want to find the position
of the dot. Using php_strtok_r requires a copy of the string, and the
implementation also relied on the specific semantics of the scratch
space that strtok_r uses.
2019-04-12 16:17:35 +02:00
Nikita Popov
2191eac3b3 Merge branch 'PHP-7.3' into PHP-7.4 2019-04-10 12:23:01 +02:00
Nikita Popov
6615b9c287 Merge branch 'PHP-7.2' into PHP-7.3 2019-04-10 12:22:34 +02:00
Nikita Popov
c7a86a38a3 Fix pgsql use after free trying to reuse closed connection
When a connection is closed, we also need to remove the hash entry
from the regular_list, as it now points to freed memory. To do this
store a reverse mapping from the connection to the hash string.

It would be nicer to introduce a wrapping structure for the pgsql
link resource that could store the hash (and notices), but that would
require large changes to the extension, so I'm going for a more
minimal fix here.
2019-04-10 12:18:57 +02:00
Nikita Popov
d50dcbe659 Merge branch 'PHP-7.3' into PHP-7.4 2019-04-10 10:38:52 +02:00
Nikita Popov
ed1df9d135 Merge branch 'PHP-7.2' into PHP-7.3 2019-04-10 10:38:32 +02:00
Nikita Popov
b55715d61a Fix use after free on pg_close() of default connection 2019-04-10 10:38:24 +02:00
Peter Kokot
92ac598aab Remove local variables
This patch removes the so called local variables defined per
file basis for certain editors to properly show tab width, and
similar settings. These are mainly used by Vim and Emacs editors
yet with recent changes the once working definitions don't work
anymore in Vim without custom plugins or additional configuration.
Neither are these settings synced across the PHP code base.

A simpler and better approach is EditorConfig and fixing code
using some code style fixing tools in the future instead.

This patch also removes the so called modelines for Vim. Modelines
allow Vim editor specifically to set some editor configuration such as
syntax highlighting, indentation style and tab width to be set in the
first line or the last 5 lines per file basis. Since the php test
files have syntax highlighting already set in most editors properly and
EditorConfig takes care of the indentation settings, this patch removes
these as well for the Vim 6.0 and newer versions.

With the removal of local variables for certain editors such as
Emacs and Vim, the footer is also probably not needed anymore when
creating extensions using ext_skel.php script.

Additionally, Vim modelines for setting php syntax and some editor
settings has been removed from some *.phpt files.  All these are
mostly not relevant for phpt files neither work properly in the
middle of the file.
2019-02-03 21:03:00 +01:00
Zeev Suraski
0cf7de1c70 Remove yearly range from copyright notice 2019-01-30 11:03:12 +02:00
Nikita Popov
ba5cb2eb32 Remove unnecessary uses of object_and_properties_init
Use object_init_ex instead if the properties are NULL.
2019-01-07 16:00:29 +01:00
Anatol Belski
fb06cca6cb Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fixed bug #77047 pg_convert has a broken regex for the 'TIME WITHOUT TIMEZONE' data type
2018-11-18 12:32:47 +01:00
Anatol Belski
0434141ce9 Fixed bug #77047 pg_convert has a broken regex for the 'TIME WITHOUT TIMEZONE' data type
Backport 369c991d and 282a63da to 7.1, closes #3634
2018-11-18 12:29:34 +01:00
Anatol Belski
8b05bbdd0a Merge branch 'PHP-7.3'
* PHP-7.3:
  Add test for bug #77047
  FIX #77047: fixes regex for "time" data type
2018-11-18 11:52:33 +01:00
andy
369c991d5c FIX #77047: fixes regex for "time" data type 2018-11-18 11:50:32 +01:00
Zeev Suraski
9afce019e0 Future-proof email addresses 2018-11-01 18:35:32 +02:00
Zeev Suraski
67e0138c0d Future-proof email addresses... 2018-11-01 18:30:28 +02:00
Gabriel Caruso
84b195d9fc Fix some misspellings 2018-08-12 16:15:45 +02:00
Peter Kokot
a5e80b22e1 Fix typos in code comments 2018-07-25 11:57:11 +02:00
Peter Kokot
8d3f8ca12a Remove unused Git attributes ident
The $Id$ keywords were used in Subversion where they can be substituted
with filename, last revision number change, last changed date, and last
user who changed it.

In Git this functionality is different and can be done with Git attribute
ident. These need to be defined manually for each file in the
.gitattributes file and are afterwards replaced with 40-character
hexadecimal blob object name which is based only on the particular file
contents.

This patch simplifies handling of $Id$ keywords by removing them since
they are not used anymore.
2018-07-25 00:53:25 +02:00
Anatol Belski
0630e3bc03 Reduce error buffer size
120 bytes is ample, the doc says.
2018-07-05 17:24:38 +02:00
Dmitry Stogov
169d454593 Use zval_ptr_dtor() imstead of zval_dtor() 2018-07-05 17:55:54 +03:00
Dmitry Stogov
4a475a4976 Replace legacy zval_dtor() by zval_ptr_dtor_nogc() or even more specialized destructors.
zval_dtor() doesn't make a lot of sense in PHP-7.* and it's used incorrectly in some places.
Its occurances should be replaced by zval_ptr_dtor() or zval_ptr_dtor_nogc(), or even more specialized destructors.
2018-07-04 19:22:24 +03:00
Anatol Belski
4ff6c0cb44 Merge branch 'PHP-7.2'
* PHP-7.2:
  Fixed bug #76548 pg_fetch_result did not fetch the next row
2018-06-29 18:36:22 +02:00
Anatol Belski
486f18f09e Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fixed bug #76548 pg_fetch_result did not fetch the next row
2018-06-29 18:35:44 +02:00
Anatol Belski
cb97fd3097 Fixed bug #76548 pg_fetch_result did not fetch the next row 2018-06-29 18:34:53 +02:00
Dmitry Stogov
0b90cf85a6 Removed "dead" code (zend_hash_update() never fails) 2018-06-01 11:58:57 +03:00
Dmitry Stogov
524f5245c5 Avoid useless checks, using zend_string_efree(), in cases where the string is known to be a temporary allocated zend_string. 2018-05-08 17:30:15 +03:00
Dmitry Stogov
eafa92ba9d zend_fcall_info_cache.calling_scope is not used by zend_call_function() and doesn't have to be initialized.
It's used only as a result of zend_is_callable() in forward_static_call and spl_autoload.
2018-05-03 19:27:04 +03:00
Anatol Belski
c4f4cc95c7 Avoid strlen calls for regexes 2018-04-19 13:29:58 +02:00
Gabriel Caruso
1314f0fb3a Use int instead of long in protos 2018-02-23 11:06:20 +01:00
Anatol Belski
34a7c6c1a5 Reduce var scope 2018-02-18 19:59:23 +01:00
Gabriel Caruso
faf785af9d Fix misspelling vlaues to values 2018-01-28 21:55:21 +01:00
Xinchen Hui
1e4deadc5b Merge branch 'PHP-7.2'
* PHP-7.2:
  Updated NEWS
  Fixed #75838 (Memory leak in pg_escape_bytea())
2018-01-18 10:54:16 +08:00
Xinchen Hui
6184301212 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fixed #75838 (Memory leak in pg_escape_bytea())
2018-01-18 10:53:39 +08:00
Xinchen Hui
fb205020ce Fixed #75838 (Memory leak in pg_escape_bytea()) 2018-01-18 10:53:23 +08:00
Dmitry Stogov
19bf64cd61 Avoid separation and simlifyed conversion 2018-01-17 12:37:42 +03:00
Xinchen Hui
a6519d0514 year++ 2018-01-02 12:57:58 +08:00
Xinchen Hui
7a7ec01a49 year++ 2018-01-02 12:55:14 +08:00
Xinchen Hui
ccd4716ec7 year++ 2018-01-02 12:53:31 +08:00
Dmitry Stogov
d9f5ea691f zend_fcall_info_cache.initialized is removed (zend_fcall_info_cache is initialized if zend_fcall_info_cache.function_handler is set). 2017-12-27 15:15:03 +03:00
Anatol Belski
2515b7a0d9 Merge branch 'PHP-7.2'
* PHP-7.2:
  Fixed bug #75671 pg_version() crashes when called on a connection to cockroach
2017-12-15 15:35:07 +01:00
Anatol Belski
171f1baff1 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fixed bug #75671 pg_version() crashes when called on a connection to cockroach
2017-12-15 15:34:44 +01:00
Anatol Belski
acf1472ffd Fixed bug #75671 pg_version() crashes when called on a connection to cockroach 2017-12-15 15:33:14 +01:00
Dmitry Stogov
9e709e2fa0 Move constants into read-only data segment 2017-12-14 18:43:44 +03:00
Dmitry Stogov
6a9d2b2190 Cleanup type conversion 2017-12-07 19:24:55 +03:00
Nikita Popov
26f8fc833b Enable and fix printf() format warnings
Add _unchecked() variants of zend_spprintf and zend_strpprintf for
cases where we specifically want to disable these checks, such as
use of %H.
2017-11-16 21:15:36 +01:00
Anatol Belski
20d930d8f3 Fix remaining signedness warnings 2017-11-14 17:07:09 +01:00
Anatol Belski
a5bc5aed71 Patch core for PCRE2 support
RFC https://wiki.php.net/rfc/pcre2-migration
2017-11-13 19:37:38 +01:00
Dmitry Stogov
67d5f39a47 Persistent resources are "thread-local".
Register persistent resources through new functions zend_register_persistent_resource()/zend_register_persistent_resource_ex().
2017-11-01 15:19:31 +03:00