From 413381e7c9f297f94dff156adc4db00ba6ba2c9b Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Sat, 8 Jan 2022 01:32:39 +0200 Subject: [ci skip] Fix CI_Session_driver_interface for PHP 5 (ref #6078) --- system/libraries/Session/OldSessionWrapper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/libraries/Session/OldSessionWrapper.php b/system/libraries/Session/OldSessionWrapper.php index 5934b5218..a8bc1d0c0 100644 --- a/system/libraries/Session/OldSessionWrapper.php +++ b/system/libraries/Session/OldSessionWrapper.php @@ -49,7 +49,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); */ class CI_SessionWrapper implements SessionHandlerInterface { - protected CI_Session_driver_interface $driver; + protected $driver; public function __construct(CI_Session_driver_interface $driver) { -- cgit v1.2.3-24-g4f1b From 52d04d27b6e172093d7d9f70c6e77846b6742742 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Sat, 8 Jan 2022 16:57:19 +0200 Subject: [ci skip] Actually use the Session wrapper (ref #6078) --- system/libraries/Session/Session.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/system/libraries/Session/Session.php b/system/libraries/Session/Session.php index 87113e2b5..9d4561616 100644 --- a/system/libraries/Session/Session.php +++ b/system/libraries/Session/Session.php @@ -107,17 +107,17 @@ class CI_Session { $wrapper = new CI_SessionWrapper($class); if (is_php('5.4')) { - session_set_save_handler($class, TRUE); + session_set_save_handler($wrapper, TRUE); } else { session_set_save_handler( - array($class, 'open'), - array($class, 'close'), - array($class, 'read'), - array($class, 'write'), - array($class, 'destroy'), - array($class, 'gc') + array($wrapper, 'open'), + array($wrapper, 'close'), + array($wrapper, 'read'), + array($wrapper, 'write'), + array($wrapper, 'destroy'), + array($wrapper, 'gc') ); register_shutdown_function('session_write_close'); -- cgit v1.2.3-24-g4f1b From 2d4ddf57cc64f37a76e53403bc1442a54cc01897 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Sat, 8 Jan 2022 17:02:48 +0200 Subject: [ci skip] Attempt to hack SameSite into session_set_cookie_params() pre-PHP7.3 --- system/libraries/Session/Session.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/libraries/Session/Session.php b/system/libraries/Session/Session.php index 9d4561616..8d3ba2857 100644 --- a/system/libraries/Session/Session.php +++ b/system/libraries/Session/Session.php @@ -336,7 +336,7 @@ class CI_Session { { session_set_cookie_params( $params['cookie_lifetime'], - $params['cookie_path'], + $params['cookie_path'].'; SameSite='.$params['cookie_samesite'], $params['cookie_domain'], $params['cookie_secure'], TRUE // HttpOnly; Yes, this is intentional and not configurable for security reasons -- cgit v1.2.3-24-g4f1b From e1ea92843ce0139417aad0933ec32d7e589d0de9 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Sat, 8 Jan 2022 22:39:06 +0200 Subject: .gitignore tests/mocks/database/ci_test.sqlite --- .gitignore | 1 + tests/mocks/database/ci_test.sqlite | Bin 19456 -> 0 bytes 2 files changed, 1 insertion(+) delete mode 100755 tests/mocks/database/ci_test.sqlite diff --git a/.gitignore b/.gitignore index 269044ea9..323f06468 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,7 @@ application/logs/* !application/*/.htaccess composer.lock +tests/mocks/database/ci_test.sqlite user_guide_src/build/* user_guide_src/cilexer/build/* diff --git a/tests/mocks/database/ci_test.sqlite b/tests/mocks/database/ci_test.sqlite deleted file mode 100755 index a46b4c016..000000000 Binary files a/tests/mocks/database/ci_test.sqlite and /dev/null differ -- cgit v1.2.3-24-g4f1b From d678dbb1937a4a3a44d335118149e53f6aacaacf Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Sat, 8 Jan 2022 22:43:04 +0200 Subject: [ci skip] Merge pull request #5729 from emrulmax2/patch-1 NOT BETWEEN syntax error DB where() issue solved --- system/database/DB_driver.php | 1 + 1 file changed, 1 insertion(+) diff --git a/system/database/DB_driver.php b/system/database/DB_driver.php index 6e1d8d11e..fd7cd5543 100644 --- a/system/database/DB_driver.php +++ b/system/database/DB_driver.php @@ -1576,6 +1576,7 @@ abstract class CI_DB_driver { '\s+EXISTS\s*\(.*\)', // EXISTS(sql) '\s+NOT EXISTS\s*\(.*\)', // NOT EXISTS(sql) '\s+BETWEEN\s+', // BETWEEN value AND value + '\s+NOT BETWEEN\s+', // NOT BETWEEN value AND value '\s+IN\s*\(.*\)', // IN(list) '\s+NOT IN\s*\(.*\)', // NOT IN (list) '\s+LIKE\s+\S.*('.$_les.')?', // LIKE 'expr'[ ESCAPE '%s'] -- cgit v1.2.3-24-g4f1b From ad57720c57c11620c77181655d637a5bfdbe2643 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Sat, 8 Jan 2022 22:45:05 +0200 Subject: [ci skip] Add changelog entry for #5729 --- user_guide_src/source/changelog.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index 0e347f891..4b75a9739 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -34,6 +34,7 @@ Bug fixes for 3.1.12 - Fixed a bug (#5903) - :doc:`common function ` :php:func:`set_status_header()` didn't recognize 'HTTP/2.0' as a valid ``$_SERVER['SERVER_PROTOCOL']``. - Fixed a bug (#6013) - :doc:`Session ` flashdata didn't work on PHP 8. - Fixed a bug (#6006) - ``is_callable()`` change in PHP 8 broke :doc:`Migrations `, a part of :doc:`XML-RPC ` and an edge case in 404 detection logic. +- Fixed a bug (#5729) - :doc:`Query Builder ` possibly not detecting ``NOT BETWEEN`` expression. Version 3.1.11 ============== -- cgit v1.2.3-24-g4f1b From 274f2f2acd48595a41416491f95c12300cd906e0 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Sun, 9 Jan 2022 09:24:18 +0200 Subject: Set error_reporting=E_ALL for unit tests --- .github/workflows/test-phpunit.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-phpunit.yml b/.github/workflows/test-phpunit.yml index 3468dfdfb..59fdfc2df 100644 --- a/.github/workflows/test-phpunit.yml +++ b/.github/workflows/test-phpunit.yml @@ -114,6 +114,6 @@ jobs: - name: PHPUnit Test run: | - php -d zend.enable_gc=0 -d date.timezone=UTC -d mbstring.func_overload=7 -d mbstring.internal_encoding=UTF-8 vendor/bin/phpunit --coverage-text --configuration tests/travis/${{ matrix.DB }}.phpunit.xml + php -d error_reporting=E_ALL -d zend.enable_gc=0 -d date.timezone=UTC -d mbstring.func_overload=7 -d mbstring.internal_encoding=UTF-8 vendor/bin/phpunit --coverage-text --configuration tests/travis/${{ matrix.DB }}.phpunit.xml env: XDEBUG_MODE: coverage -- cgit v1.2.3-24-g4f1b From 6a7254ca653b08e2b73ffd58b18c2bf70b8bd35e Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Sat, 15 Jan 2022 15:09:45 +0200 Subject: [ci skip] Fix a coding typo from 1a2651040ef701e750b1c13cd69cc70814b079d0 --- system/libraries/Session/Session.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/libraries/Session/Session.php b/system/libraries/Session/Session.php index 8d3ba2857..68dc0ab63 100644 --- a/system/libraries/Session/Session.php +++ b/system/libraries/Session/Session.php @@ -182,7 +182,7 @@ class CI_Session { if ( ! $this->_config['cookie_secure'] && $this->_config['cookie_samesite'] === 'None') { - log_message('error', 'Session:', $this->_config['cookie_name'].' cookie sent with SameSite=None, but without Secure attribute.'); + log_message('error', "Session: '".$this->_config['cookie_name']."' cookie sent with SameSite=None, but without Secure attribute.'"); } } -- cgit v1.2.3-24-g4f1b