Commit Graph

788 Commits

Author SHA1 Message Date
Tim Starling
c96be7b8f2 Use ASCII lower case for misc case folding
Use ASCII case conversion instead of locale-dependent case conversion in
the following places:

* grapheme_stripos() and grapheme_strripos() in the "fast" path
* ldap_get_entries()
* oci_pconnect() for case folding of parameters when constructing a key
  into the connection or session pool
* SoapClient: case folding of function names
* get_meta_tags(): case conversion of property names
* http stream wrapper: header names
* phpinfo(): anchor names
* php_verror(): docref URLs
* rfc1867.c: Content-Type boundary parameter name
* streams.c: stream protocol names

Using locale-dependent case folding for these cases is either
unnecessary or actively incorrect. These functions could have
misbehaved when used with certain locales (e.g. Turkish).

Closes GH-7511.
2021-09-24 09:20:08 +02:00
Máté Kocsis
d824eaee33
Merge branch 'PHP-8.1'
* PHP-8.1:
  Add more specific array return type hints for various extensions - part 3
2021-09-06 12:27:57 +02:00
Máté Kocsis
6a47831e6e
Add more specific array return type hints for various extensions - part 3 (#7467) 2021-09-06 12:27:28 +02:00
Nikita Popov
218fd03532 Fix some more CLEANUP sections 2021-09-03 14:10:40 +02:00
Máté Kocsis
2378f35787
Use single line phpdoc in stubs where possible 2021-07-20 13:16:56 +02:00
Joe Watkins
570d9b63e9
Not serializable flag permeation 2021-07-20 12:28:35 +02:00
Máté Kocsis
b382883696
Indent stubs inside global namespace blocks (#7261) 2021-07-20 10:23:58 +02:00
Patrick Allaert
ac18dd0dc7 Prefer EXPECT over EXPECTF 2021-06-29 17:13:02 +02:00
Nikita Popov
849a34e490 Use EXTENSIONS section for ldap 2021-06-14 10:41:33 +02:00
Nikita Popov
748568268a Make LDAPCONF test work on windows
Rather than using putenv(), use the ENV section. This also
required adding {PWD} support for it.
2021-06-14 10:40:18 +02:00
Nikita Popov
7485978339
Migrate SKIPIF -> EXTENSIONS (#7138)
This is an automated migration of most SKIPIF extension_loaded checks.
2021-06-11 11:57:42 +02:00
George Peter Banyard
a6a95e3f51
Do not reuse errno as local variable name
errno is a global variable/macro which is implementation defined,
and should not be reused.

This fixes some [-Wstrict-prototypes] warnings.
2021-05-12 15:32:16 +01:00
Ayesh Karunaratne
e0b947a8da
Move resource-object classes of LDAP to \LDAP namespaces (#6963)
Another change as per accepted [namespaces in bundled extensions RFC](https://wiki.php.net/rfc/namespaces_in_bundled_extensions).

Related: #6925, #5945, #6960
2021-05-09 22:20:21 +02:00
KsaR
01b3fc03c3
Update http->https in license (#6945)
1. Update: http://www.php.net/license/3_01.txt to https, as there is anyway server header "Location:" to https.
2. Update few license 3.0 to 3.01 as 3.0 states "php 5.1.1, 4.1.1, and earlier".
3. In some license comments is "at through the world-wide-web" while most is without "at", so deleted.
4. fixed indentation in some files before |
2021-05-06 12:16:35 +02:00
George Peter Banyard
5caaf40b43
Introduce pseudo-keyword ZEND_FALLTHROUGH
And use it instead of comments
2021-04-07 00:46:29 +01:00
Máté Kocsis
cd40fc3cb1
Convert resources to objects in ext/ldap
Closes GH-6770
2021-03-21 10:43:25 +01:00
Máté Kocsis
66f16f4eb2
Merge branch 'PHP-8.0'
* Fix crash in LDAP search functions during argument validation
* Fix ldap_next_entry() parameter name
2021-03-16 09:34:41 +01:00
Máté Kocsis
465aa1d38f
Fix ldap_next_entry() parameter name 2021-03-16 09:31:46 +01:00
Máté Kocsis
b03438ba3a
Fix crash in LDAP search functions during argument validation 2021-03-16 09:31:37 +01:00
Máté Kocsis
cad66533f0
Generate class entries from stubs for ldap, libxml, mbstring and mysqli
Closes GH-6684
2021-02-16 14:46:19 +01:00
Nikita Popov
b10416a652 Deprecate passing null to non-nullable arg of internal function
This deprecates passing null to non-nullable scale arguments of
internal functions, with the eventual goal of making the behavior
consistent with userland functions, where null is never accepted
for non-nullable arguments.

This change is expected to cause quite a lot of fallout. In most
cases, calling code should be adjusted to avoid passing null. In
some cases, PHP should be adjusted to make some function arguments
nullable. I have already fixed a number of functions before landing
this, but feel free to file a bug if you encounter a function that
doesn't accept null, but probably should. (The rule of thumb for
this to be applicable is that the function must have special behavior
for 0 or "", which is distinct from the natural behavior of the
parameter.)

RFC: https://wiki.php.net/rfc/deprecate_null_to_scalar_internal_arg

Closes GH-6475.
2021-02-11 21:46:13 +01:00
Christoph M. Becker
a4992cbf66 Merge branch 'PHP-8.0'
* PHP-8.0:
  ldap_search() and friends can return array
2021-01-19 10:35:35 +01:00
Christoph M. Becker
f33105dcb6 ldap_search() and friends can return array
See the description of <https://www.php.net/ldap-search>, and also the
implementation.

Closes GH-6620.
2021-01-19 10:35:17 +01:00
Nikita Popov
3e01f5afb1 Replace zend_bool uses with bool
We're starting to see a mix between uses of zend_bool and bool.
Replace all usages with the standard bool type everywhere.

Of course, zend_bool is retained as an alias.
2021-01-15 12:33:06 +01:00
Nikita Popov
422d1665a2 Make convert_to_*_ex simple aliases of convert_to_*
Historically, the _ex variants separated the zval first, if a
conversion was necessary. This distinction no longer makes sense
since PHP 7.

The only difference that was still left is that _ex checked whether
the type is the same first, but the usage of these macros did not
actually distinguish on whether such an inlined check is valuable
or not in a given context.

Also drop the unused convert_to_explicit_type macros.
2021-01-14 12:11:11 +01:00
Christoph M. Becker
c3734f9ae1 ldap_exop_whoami() does not return TRUE
Closes GH-6496.
2020-12-08 11:44:04 +01:00
Côme Chilliet
15a3eca3ef Change $controls parameter to default to null in ext/ldap
It appeared that not passing $controls and passing [] caused different
 behaviors, when not passing it the controls set through ldap_set_option
 would be used, when passing [] they would not.

So, this parameter is now nullable and defaults to null to have a
 consistent behavior.
2020-10-15 11:48:47 +02:00
Nikita Popov
1610e81b51 Mark ldap_exop() param as UNKNOWN
This function actually has very different behavior depending on
whether $response_data is passed or not.
2020-10-14 16:38:56 +02:00
Côme Chilliet
550a4f2fa8 Remove deprecated functions from php-ldap
Remove ldap_control_paged_result and ldap_control_paged_result_response
 which have been deprecated in PHP 7.4, in favor of new $controls
 parameters for ldap request functions.
2020-10-01 10:15:27 +02:00
Côme Chilliet
1945355435 Improve parameter names in ext/ldap
Merging PR 6153
2020-09-29 16:31:08 +02:00
MCMic
3b3445f783 Harmonize ldap_rename_ext with ldap_rename parameter names
Co-authored-by: Nikita Popov <nikita.ppv@googlemail.com>
2020-09-29 16:31:08 +02:00
Côme Chilliet
1d3787ee94 Rename $link parameters to $ldap in ldap functions
Also fixed ldap_set_option places where $newvalue was still used
2020-09-29 16:31:08 +02:00
MCMic
29e1a9717d Improve parameter naming in ldap_rename
Co-authored-by: Nikita Popov <nikita.ppv@googlemail.com>
2020-09-29 16:31:08 +02:00
MCMic
462c94447e Improve parameter naming in ldap_exop_passwd
Co-authored-by: Nikita Popov <nikita.ppv@googlemail.com>
2020-09-29 16:31:08 +02:00
MCMic
27fe37e394 Improve parameter naming in ldap_connect
Co-authored-by: Nikita Popov <nikita.ppv@googlemail.com>
2020-09-29 16:31:08 +02:00
MCMic
febd33cf7e Improve parameter naming in ldap_set_option ext/ldap/ldap.stub.php
Co-authored-by: Nikita Popov <nikita.ppv@googlemail.com>
2020-09-29 16:31:07 +02:00
Côme Chilliet
fa1f86f11c Explicitely mark nullable strings 2020-09-29 16:31:07 +02:00
MCMic
a835eee2cf Fix parameter mask in ldap_next_attribute
Co-authored-by: Nikita Popov <nikita.ppv@googlemail.com>
2020-09-29 16:31:07 +02:00
Côme Chilliet
c2a6da5ab2 Fix parameter names in ext/ldap
Renamed all parameters to be consistent and concise
2020-09-29 16:31:07 +02:00
Côme Chilliet
2a34d35a66 Fix "null" case in ldap.stub.php 2020-09-29 16:31:07 +02:00
Côme Chilliet
eeec37d31d Remove dummy_ber parameter from ldap_first_attribute and ldap_next_attribute
It has been unused and deprecated since PHP 5.2.4
2020-09-29 16:31:07 +02:00
Côme Chilliet
caa0cd7705 Set all parameters to ldap_sasl_bind as NULL by default
For mech, realm, authcid, authzid and props NULL means do not change
 current server setting.
2020-09-29 16:31:07 +02:00
Côme Chilliet
74b634751b Default bind dn and password to NULL in ldap_bind_ext 2020-09-29 16:31:07 +02:00
Côme Chilliet
14385fb203 Default bind dn and password to NULL in ldap_bind 2020-09-29 16:31:07 +02:00
Côme Chilliet
6b77252f18 Make URI parameter in ldap_connect default to NULL 2020-09-29 16:31:07 +02:00
Máté Kocsis
e950ca13ea
Consolidate the usage of "either" and "one of" in error messages
Closes GH-6173
2020-09-20 19:41:47 +02:00
Nikita Popov
c5401854fc Run tidy
This should fix most of the remaining issues with tabs and spaces
being mixed in tests.
2020-09-18 14:28:32 +02:00
Máté Kocsis
36fd95b524
Generate arginfos 2020-09-16 21:28:27 +02:00
Máté Kocsis
de912821e0
Display string default values in stubs more uniformly
Settling on using quoted string
2020-09-16 21:27:01 +02:00
Máté Kocsis
c98d47696f
Consolidate new union type ZPP macro names
They will now follow the canonical order of types. Older macros are
left intact due to maintaining BC.

Closes GH-6112
2020-09-11 11:00:18 +02:00
Máté Kocsis
36cdbd0549
Promote warnings to exceptions in ext/ldap
Closes GH-6065
2020-09-04 15:26:16 +02:00
Máté Kocsis
8107a1da5a
Use ZPP instead of custom type checks
We can add these types as a native type declaration to stubs as a side-effect. Closes GH-6068
2020-09-04 14:32:34 +02:00
George Peter Banyard
96c7d42a3c Use ZPP callable check for ldap_set_rebind_proc() 2020-08-13 21:14:51 +02:00
Máté Kocsis
046cc5e4c2
Add another round of missing parameter types to stubs
Closes GH-5950
2020-08-07 16:48:45 +02:00
Máté Kocsis
6b7e2f0d15
Fix stub hash of ext/ldap 2020-08-03 01:06:21 +02:00
Máté Kocsis
79981a394e
Add a bunch of missing argument types to stubs 2020-08-03 00:45:51 +02:00
Máté Kocsis
156c1806db
Convert the $ttl parameter of ldap_exop_refresh() to int 2020-08-03 00:38:59 +02:00
Côme Chilliet
08dcb8e604 Merge branch 'PHP-7.4'
* PHP-7.4:
  Updated NEWS
  fix memory leaks in ext/ldap/ldap.c
  fix memory leaks in ext/ldap/ldap.c
2020-07-28 10:29:59 +02:00
Paweł Tomulik
fef5a9e502 fix memory leaks in ext/ldap/ldap.c 2020-07-28 10:27:22 +02:00
Máté Kocsis
d30cd7d7e7
Review the usage of apostrophes in error messages
Closes GH-5590
2020-07-10 21:05:28 +02:00
Nikita Popov
bc68f10b76 Merge branch 'PHP-7.4'
* PHP-7.4:
  enable ext/ldap/tests on azure
  fix some ext/ldap/tests
2020-07-10 09:57:13 +02:00
Paweł Tomulik
b291c92693 enable ext/ldap/tests on azure 2020-07-10 09:56:02 +02:00
Paweł Tomulik
c6ab3084df fix some ext/ldap/tests 2020-07-10 09:56:02 +02:00
Nikita Popov
bee2cf0899 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix some memory bugs in ldap.c
2020-07-10 09:50:12 +02:00
Nikita Popov
22352868ec Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix some memory bugs in ldap.c
2020-07-10 09:49:50 +02:00
Paweł Tomulik
23ef0a1285 Fix some memory bugs in ldap.c 2020-07-09 18:35:00 +02:00
Max Semenik
2b5de6f839
Remove proto comments from C files
Closes GH-5758
2020-07-06 21:13:34 +02:00
Nikita Popov
0280b83e11 Avoid some unnecessary uses of no_separation=0
For the rare cases where references are part of the API,
construct them explicitly. Otherwise do not allow separation.
2020-07-06 19:05:57 +02:00
Paweł Tomulik
915abeb699 Add ldap_count_references()
Closes GH-5784
2020-07-01 09:29:46 +02:00
Paweł Tomulik
b3698ed9eb
Promote warning to exception in ldap_set_rebind_proc()
From now on, ldap_set_rebind_proc() will only accept callable or null
as argument 2.

Closes GH-5763
2020-06-30 16:08:34 +02:00
Fabien Villepinte
0c6d06ecfa Replace EXPECTF when possible
Closes GH-5779
2020-06-29 21:31:44 +02:00
Christoph M. Becker
07ff243f07 Fix macro redifinition warnings in debug builds
MSVC considers these warnings[1] to be severe (level 1), so we better
fix the respective code.

[1] <https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4005?view=vs-2019>
2020-06-29 19:11:22 +02:00
Nikita Popov
c9b9f525a9 Include stub hash in generated arginfo files
The hash is used to check whether the arginfo file needs to be
regenerated. PHP-Parser will only be downloaded if this is actually
necessary.

This ensures that release artifacts will never try to regenerate
stubs and thus fetch PHP-Parser, as long as you do not modify any
files.

Closes GH-5739.
2020-06-24 09:55:19 +02:00
George Peter Banyard
046ff29958 Fix [-Wundef] warnings in LDAP extension 2020-05-18 00:37:15 +02:00
George Peter Banyard
b91c2845cf Drop check for HAVE_NSLDAP
This constant is never defined thus useless
2020-05-16 00:40:37 +02:00
Máté Kocsis
e088836bbc
Fix nullable types in PHPDoc 2020-04-12 00:25:33 +02:00
Máté Kocsis
3709e74b5e
Store default parameter values of internal functions in arg info
Closes GH-5353. From now on, PHP will have reflection information
about default values of parameters of internal functions.

Co-authored-by: Nikita Popov <nikita.ppv@gmail.com>
2020-04-08 18:37:51 +02:00
Máté Kocsis
610815c0ce
Improve gen_stub.php
Closes GH-5350
Add support for generating deprecated function entries, as well as forward declaration
of function aliases.
2020-04-04 23:52:33 +02:00
Máté Kocsis
a43bc33fb2
Annotate function aliases in stubs 2020-04-04 13:03:16 +02:00
Máté Kocsis
736b22dc0b
Add stubs for aliases
Closes GH-5187
2020-02-18 21:10:36 +01:00
Christoph M. Becker
7d0102dfa7 Revert "Replace @param annotations with type declarations"
This reverts commit c31029f335.
2020-02-17 08:55:18 +01:00
Christoph M. Becker
c31029f335 Replace @param annotations with type declarations 2020-02-16 23:43:38 +01:00
George Peter Banyard
c3e65d9069 Fix [-Wtype-limits] warning in LDAP by removing unnecessary condition
As context is a pointer to a berval struct and bv_len is of type
ber_len_t [1] which it self is defined as an unsigned integer [2]
this condition is always true.

[1] https://www.openldap.org/devel/gitweb.cgi?p=openldap.git;a=blob;f=include/lber.h#l212
[2] https://www.openldap.org/software//man.cgi?query=ber_free&sektion=3&apropos=0&manpath=OpenLDAP+2.4-Release
2020-02-06 13:20:15 +01:00
Nikita Popov
f8d795820e Reindent phpt files 2020-02-03 22:52:20 +01:00
Máté Kocsis
d1764ca330
Make error messages more consistent by fixing capitalization
Closes GH-5066 As a first step, let's capitalize their initial letter when it is applicable.
2020-01-17 14:52:46 +01:00
Máté Kocsis
afdaa91170
Fix #78880: Final spelling fixes 2020-01-16 19:14:31 +01:00
Máté Kocsis
1abea33b1e
Fix usage of RETURN_THROWS() in LDAP extension 2020-01-03 22:40:16 +01:00
Máté Kocsis
aadd3aaed9
Use RETURN_THROWS() in various places 2020-01-03 21:10:24 +01:00
Máté Kocsis
bbcfa66e06
Use RETURN_THROWS() after zend_fetch_resource*() 2020-01-03 19:20:56 +01:00
Christoph M. Becker
d694edaee4 Fix erroneous change 2019-12-31 12:24:01 +01:00
Máté Kocsis
345703724c
Use RETURN_THROWS() during ZPP in most of the extensions
Except for some bigger ones: reflection, sodium, spl
2019-12-31 11:46:11 +01:00
Máté Kocsis
27e83d0fb8
Add union return types for function stubs 2019-11-11 14:54:55 +01:00
Fabien Villepinte
a555cc0b3d Clean DONE tags from tests
Remove most of the `===DONE===` tags and its variations.
Keep `===DONE===` if the test output otherwise becomes empty.

Closes GH-4872.
2019-11-07 21:31:47 +01:00
Máté Kocsis
9493893412 Cleanup return values when parameter parsing is unsuccessful 2019-10-30 16:05:20 +01:00
Christoph M. Becker
0436bc875e Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix miscellaneous typos in docs
2019-10-19 19:20:25 +02:00
Tyson Andre
38f388fba4 Fix miscellaneous typos in docs 2019-10-19 19:19:28 +02:00
Nikita Popov
646dc19048 Suppress fsockopen error in ldap_set_rebind_proc_error.phpt 2019-10-01 22:02:47 +02:00
Christoph M. Becker
76179cdf3d Merge branch 'PHP-7.4'
* PHP-7.4:
  Add missing skip keyword in tests
  Update NEWS for 7.4.0RC4
  Update NEWS for PHP 7.4.0RC3
2019-10-01 11:19:43 +02:00
Christoph M. Becker
73f29a5c5e Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Add missing skip keyword in tests
2019-10-01 11:17:53 +02:00
Nikita Popov
235983dfde Merge branch 'PHP-7.4' 2019-09-30 17:52:39 +02:00