Commit graph

8032 commits

Author SHA1 Message Date
Kamil Wylegala
61c8f9ad25
Added PDOException wrapper to avoid creating dynamic property. (#77) 2024-09-21 12:53:44 +02:00
Markus Bauer
2220f35b1b
Remove constructs that deprecate with PHP 8.4 (#75)
* Remove constructs that deprecate with PHP 8.4

* Fix SecurityComponent typing

---------

Co-authored-by: Markus Bauer <markus.bauer@cispa.saarland>
2024-07-24 21:55:01 +02:00
Markus Bauer
c0fb45e79e
Fix potential CSRF circumvention with custom HTTP methods (#76)
* Backported patch, fixing potential CSRF circumvention with custom HTTP methods.

Upstream: 0f818a23a8

* Fix unit tests for SecurityComponent

---------

Co-authored-by: Markus Bauer <markus.bauer@cispa.saarland>
2024-07-24 18:13:57 +02:00
Kamil Wylegala
b918df8008
Intl recommendation + PHP81_BC\strftime + Symfony ICU Polyfill (#69)
* Intl extension requirement.

* CakeTime migrated to Intl.

* FormHelper migration strftime to Intl.

* Readme update.
2024-06-05 22:21:39 +02:00
Kamil Wylegala
eed5974b24
False to array conversion fix. (#73) 2024-05-24 22:27:19 +02:00
Patrick Barabe
0f45d97c71
Fix deprecation error in I18n (#71)
Utility\I18n's protected _bindTextDomain method was sometimes assigning an array key
to an array element that evaluated as false. This was trigging deprecation error
'Automatic conversion of false to array is deprecated'.

This modification checks whether the array element is false and explicitly converts it
to an array if it is.

closes #70
2024-05-22 18:00:49 +02:00
Jan Pešek
9140745ef1
fix: get rid of (some) PHP deprecation warnings (#66)
- CakeResponse.php strlen() no longer accepts null as a parameter

Co-authored-by: Jan Pešek <jan@sinch.cz>
2024-02-03 10:26:26 +01:00
Diego Surita
32459b11b6
Fix some deprecation warnings (#64)
* Fix PHP 8.1 deprecation warnings on Helper and FormHelper

- fix deprecation warning when Helper::_entityPath is null
- fix `strftime` function deprecation warning on FormHelper::_getDateTimeValue method

ref: ARCH-11

* Switch deprecated utf8_encode function to mb_convert_encoding function

ref: ARCH-13

* Hide strftime deprecation warning

Since CakePHP 2 doesn't require the installation of `intl` PHP extension in it's documentation, I can't use the alternative `IntlDateFormatter::format` because it relies such extension.

ref: ARCH-13

* Roll back the use of strftime

ref: ARCH-11

* Fix preg_split subject param null deprecated on FormHelper::dateTime

* Fix preg_split deprecated null param limit on CakeResponse::checkNotModified

* fix: get rid of (some) PHP deprecation warnings

- CakeResponse.php strotime() and preg_split() warnings

* Ignore hide srtftime function deprecation warning from PHPCS

* Fix typo on phpcs ignore comments

---------

Co-authored-by: Jan Pešek <jan@sinch.cz>
2024-01-29 22:49:02 +01:00
Jan Pešek
a83e9c77bb fix: get rid of (some) PHP deprecation warnings
- CakeResponse.php strotime() and preg_split() warnings
2024-01-19 22:35:39 +01:00
Juan Cruz Vincenti
84cfdfb0c3 Fix some PHP 8.1 deprecation warnings
* Fix passing null to str_replace and preg_replace in HttpSocket
* Fix dynamic props usage in ModelValidator
* Fix passing null to rawurlencode in CakeRoute
2024-01-11 23:02:17 +01:00
Diego Surita
fa1f817be2 Fix passing null deprecation warning on CakeText::insert method
Warning message: `Deprecated (8192): preg_quote(): Passing null to parameter #1 ($str) of type string is deprecated [vendor/cakephp/cakephp/lib/Cake/Utility/CakeText.php, line 168]`
2023-12-22 15:19:51 +01:00
Diego Surita
b4e0e7f080 Change Hash callback class reference on filter method 2023-12-19 22:24:08 +01:00
Diego Surita
7acb7c2938 Fix Hash class callback callable pattern deprecated 2023-12-19 22:24:08 +01:00
Diego Surita
e712b2da89 Fix dynamic property creation deprecation warning from CakeEvent class 2023-12-19 22:23:26 +01:00
Diego Surita
0b0ec3ef40 Fix dynamic property creation deprecation warning
There are many classes that create properties dynamically (Controller class for example).
2023-12-19 22:23:26 +01:00
Diego Surita
8473730ba2 Fix passing a null input to h function
Fix the following deprecation warning: Deprecated (8192): htmlspecialchars(): Passing null to parameter #1 ($string) of type string is deprecated [APP/Vendor/cakephp/cakephp/lib/Cake/basics.php, line 231]
2023-12-19 15:27:45 +01:00
Kamil Wylegala
219d13c0f0 Allowed dynamic properties in model. 2023-11-13 23:23:07 +01:00
daris
1a06136cb0 Fix trying to read uninitialized properties when fetching call stack during exception handling
"Typed property ... must not be accessed before initialization" error was displayed instead of CakePHP error page with call stack
2023-11-02 09:32:49 +01:00
MassimoI
1cd99ff3e0 solving the named parameters incompatibility 2023-10-23 15:56:03 +02:00
Jan Pešek
0f1bb51402 fix: get rid of (some) PHP deprecation warnings
- RequestHandlerComponent might not have CONTENT_TYPE env set
- basics.php might not have SCRIPT_URI env set
2023-10-20 09:26:46 +02:00
Kamil Wylegala
98ecc6cfc3 Removed usage of deprecated getKeys in favor of keys() from phpredis 2023-10-19 23:25:34 +02:00
daris
5dbc22efd3 Fixed deprecation warning when parsing parameters in ShellDispatcher.php
PHP Deprecated:  strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in lib/Cake/Console/ShellDispatcher.php on line 295

It broke some behat tests for my project because PHP issued warning and then session has not been able to start correctly due to "Session cannot be started after headers have already been sent" error
2023-09-18 19:34:17 +02:00
Jan Pešek
cc74b59637 feat(#46): get rid of (some) PHP deprecation warnings
- use issets, default local var values, better/newer language constructs
2023-08-18 18:17:39 +02:00
Kamil Wylegala
de95041969
Fixed PHP 8.2 deprecation notices in CakeEvent class. (#43)
* Fixed PHP 8.2 deprecation notices in CakeEvent class.
2023-06-02 23:18:08 +02:00
Koji Tanaka
b5ebe993ad fix: Undefined TESTS constants cause the "cake bake project" command to exit with an error 2023-03-12 12:04:43 +01:00
Koji Tanaka
797b7e0a3c test: MysqlTest::testTinyintCasting() Use assertEquals for assertions as in other record-retrieval tests. 2023-02-19 13:58:40 +01:00
Koji Tanaka
747f9e3d13 test: Fixed improved return value of mocked PDO class exec() method.
Return value of PDO::exec() is the number of rows affected,
which is 0 for any of these method calls.
2023-02-19 13:58:40 +01:00
Koji Tanaka
7df7fefca4 test: Separate FormHelperTest::testSecuredFileInput() by PHP Version.
Added 'full_path' key
https://www.php.net/manual/en/migration81.new-features.php#migration81.new-features.core.upload-full-path-key
2023-02-19 13:58:40 +01:00
Koji Tanaka
9115ec765f test: Skip DebuggerTest::testExportVarRecursion() in PHP 8.1+.
PHP 8.1+, $GLOBALS no longer has $GLOBALS as an element.
2023-02-19 13:58:40 +01:00
Koji Tanaka
0489533600 test: Fixed expected value when float value is specified in DboSource::value() argument. 2023-02-11 13:58:44 +01:00
Koji Tanaka
ddd53dd874 test: Fixed PostgresTest::testAlterSchema()
The last few lines of PostgresTest::testAlterSchema() were added in the following commit. There was a problem, but the test succeeds in less than PHP 7.4.
6a4e7558fc (diff-bb8406239275388d1950fd590496d45d70b9e85b1c521ec75837e1138c9743d9)
In PHP 7.4+, after executing DboSource::dropSchema(), executing DboSource::alterSchema() raises a "Warning Error" and the test fails.
2023-02-11 13:58:44 +01:00
Koji Tanaka
ca2c909ac9 test: Restore if LC_NUMERIC is changed during testing.
Improved PostgresTest::testLocalizedFloats().
This test changes the locale (LC_NUMERIC) and restores it last. Therefore, if the test failed, subsequent tests referencing the locale could fail.
2023-02-11 13:58:44 +01:00
Koji Tanaka
1d1750ae8c fix: PaginatorHelper::numbers() generates extra separator string in PHP 8.0+. 2023-01-30 21:28:56 +01:00
Koji Tanaka
3acfb1da49 fix: Relative time may not be cached if specified in CacheHelper duration 2023-01-22 14:24:47 +01:00
Koji Tanaka
94f73e75e6 fix: Checking with get_magic_quotes_gpc() is no longer necessary. 2023-01-11 22:45:29 +01:00
Koji Tanaka
85452fd81c test: Skip test PaginatorHelperTest::testNumbers() 2023-01-11 22:45:29 +01:00
Koji Tanaka
3721b5bec2 test: Skip a part of test for Mysql
Some strings are not quoted correctly in PHP 8.0+.
2023-01-11 22:45:29 +01:00
Koji Tanaka
d21c18e079 test: Skip some tests for cache feature
If expiration date is specified as a relative time, there is a bug that prevents the test from being cached, so the test is skipped.
2023-01-11 22:45:29 +01:00
Koji Tanaka
f369064c7d test: In PHP 8.0+ DebuggerTest::testOutput() marked as incomplete. 2023-01-11 22:45:29 +01:00
Koji Tanaka
7baab67d65 fix: Fixed error generation in MootoolsEngineHelper::drop()
Co-authored-by: Kenshin Okinaka <okinakak@yahoo.co.jp>
2023-01-11 22:45:29 +01:00
Koji Tanaka
fb5e694ef7 fix: The get_magic_quotes_gpc function was removed in PHP 8.0, so check before calling it. 2023-01-11 22:45:29 +01:00
Koji Tanaka
cbf4682ad5 test: Change the test to match the behavior of the MailTransport class.
see: https://github.com/kamilwylegala/cakephp2-php8/pull/20

Co-authored-by: Kenshin Okinaka <okinakak@yahoo.co.jp>
2023-01-11 22:45:29 +01:00
Koji Tanaka
5ab5310120 test: Fixed FileTest::testPermission()
Co-authored-by: Kenshin Okinaka <okinakak@yahoo.co.jp>
2023-01-11 22:45:29 +01:00
Koji Tanaka
fd5f39df07 test: Fixed CakeNumberTest::testCurrencyFractionSymbol()
Change in behavior of == comparison operators in PHP 8.0 has revealed a bug in the test code.
 see: https://www.php.net/manual/en/migration80.incompatible.php#migration80.incompatible.core.string-number-comparision

 Co-authored-by: Kenshin Okinaka <okinakak@yahoo.co.jp>
2023-01-11 22:45:29 +01:00
Koji Tanaka
c82693b920 test: Fixed DebuggerTest
Some tests relied on output format settings in other tests.
2023-01-11 22:45:29 +01:00
Koji Tanaka
d47407353b test: Update DebuggerTest for PHP 8.0+ 2023-01-11 22:45:29 +01:00
Koji Tanaka
1d6fd78d45 test: Fix ConnectionManagerTest::testSourceList().
Co-authored-by: Kenshin Okinaka <okinakak@yahoo.co.jp>
2023-01-11 22:45:29 +01:00
Koji Tanaka
bab8a84436 test: Improved MemcachedEngineTest/MemcacheEngineTest. 2023-01-11 22:45:29 +01:00
Koji Tanaka
d7d7230929 test: Fix CakeEmailTest::testResetWithCharset()
Co-authored-by: Kenshin Okinaka <okinakak@yahoo.co.jp>
2023-01-11 22:45:29 +01:00
Koji Tanaka
7c55817dbc test: Change TLS version used in testEnableCryptoTlsV11().
Co-authored-by: Kenshin Okinaka <okinakak@yahoo.co.jp>
2023-01-11 22:45:29 +01:00