-
Notifications
You must be signed in to change notification settings - Fork 43
[BUGS-5809] Add fallback for $session->get_data() #237
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
if $session is not null but the ->get_data is this creates a PHP warning It's possible this might escallate to a fatal in PHP 8+ Originally reported in https://wordpress.org/support/topic/php-warning-session_start-failed-to-read-session-data-user/
I fundamentally disagree with the guidance that they are "rarely used correctly"
| <!-- Excluded sniffs --> | ||
| <rule ref="Universal.Operators.DisallowShortTernary.Found"> | ||
| <exclude-pattern>*/inc/*</exclude-pattern> | ||
| <exclude-pattern>pantheon-sessions.php</exclude-pattern> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line isn't explicitly required and could be removed if we want to. It's doubtful we'd ever need short ternaries in the main plugin file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"exclude short ternaries being disallowed" what a roundabout way of saying "allow short ternaries" 😁
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess you could describe it that way 🙄 😂
* Update images for lint and test-behat jobs * Bump yoast/phpunit-polyfills from 1.0.3 to 1.0.4 * Bump dealerdirect/phpcodesniffer-composer-installer from 0.7.2 to 1.0.0 (#229) Bumps [dealerdirect/phpcodesniffer-composer-installer](https://github.com/Dealerdirect/phpcodesniffer-composer-installer) from 0.7.2 to 1.0.0. - [Release notes](https://github.com/Dealerdirect/phpcodesniffer-composer-installer/releases) - [Changelog](https://github.com/PHPCSStandards/composer-installer/blob/main/.github_changelog_generator) - [Commits](PHPCSStandards/composer-installer@v0.7.2...v1.0.0) --- updated-dependencies: - dependency-name: dealerdirect/phpcodesniffer-composer-installer dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * [CMSP-79] PHP 8.2 (#232) * Bump grunt from 1.5.3 to 1.6.1 (#235) * fix GPL license version (#236) * Add CMS Platform to CODEOWNERS (#239) * [BUGS-5809] Add fallback for $session->get_data() (#237) * fix GPL license version * add a fallback if $session is not null but the ->get_data is this creates a PHP warning It's possible this might escallate to a fatal in PHP 8+ Originally reported in https://wordpress.org/support/topic/php-warning-session_start-failed-to-read-session-data-user/ * exclude short ternaries being disallowed I fundamentally disagree with the guidance that they are "rarely used correctly" * bump version * update/add changelog --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: John Spellman <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Update images for lint and test-behat jobs * Bump yoast/phpunit-polyfills from 1.0.3 to 1.0.4 * Bump dealerdirect/phpcodesniffer-composer-installer from 0.7.2 to 1.0.0 (#229) Bumps [dealerdirect/phpcodesniffer-composer-installer](https://github.com/Dealerdirect/phpcodesniffer-composer-installer) from 0.7.2 to 1.0.0. - [Release notes](https://github.com/Dealerdirect/phpcodesniffer-composer-installer/releases) - [Changelog](https://github.com/PHPCSStandards/composer-installer/blob/main/.github_changelog_generator) - [Commits](PHPCSStandards/composer-installer@v0.7.2...v1.0.0) --- updated-dependencies: - dependency-name: dealerdirect/phpcodesniffer-composer-installer dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * [CMSP-79] PHP 8.2 (#232) * Bump grunt from 1.5.3 to 1.6.1 (#235) * fix GPL license version (#236) * Add CMS Platform to CODEOWNERS (#239) * [BUGS-5809] Add fallback for $session->get_data() (#237) * fix GPL license version * add a fallback if $session is not null but the ->get_data is this creates a PHP warning It's possible this might escallate to a fatal in PHP 8+ Originally reported in https://wordpress.org/support/topic/php-warning-session_start-failed-to-read-session-data-user/ * exclude short ternaries being disallowed I fundamentally disagree with the guidance that they are "rarely used correctly" * bump version * update/add changelog * Remove gruntfile and package.json (#243) The only thing this was being used for was a readme to markdown script that we're not using. * Update the "necessary assets" step (#242) * Update the "necessary assets" step Replace "Confirm that the necessary assets are present in the newly created tag, and test on a WP install if desired" with the actual step for this repository. * call out .gitattributes, specifically Co-authored-by: John Spellman <[email protected]> * remove extra number list item --------- Co-authored-by: John Spellman <[email protected]> * Bump yoast/phpunit-polyfills from 1.0.4 to 1.0.5 (#245) Bumps [yoast/phpunit-polyfills](https://github.com/Yoast/PHPUnit-Polyfills) from 1.0.4 to 1.0.5. - [Release notes](https://github.com/Yoast/PHPUnit-Polyfills/releases) - [Changelog](https://github.com/Yoast/PHPUnit-Polyfills/blob/2.x/CHANGELOG.md) - [Commits](Yoast/PHPUnit-Polyfills@1.0.4...1.0.5) --- updated-dependencies: - dependency-name: yoast/phpunit-polyfills dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * bump version & update changelog * add john to contributors * explicitly define which symfony/yaml to use * update composer so it pulls the right symfony/yaml * we actually shouldn't need to define symfony/yaml if we do a composer update before install for 7.4 tests --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: John Spellman <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Reported in https://wordpress.org/support/topic/php-warning-session_start-failed-to-read-session-data-user/
If
$sessionhas some data, butget_data()method returns null, a PHP warning will appear in the error logs. User reported that they suspect it's when a session is opened but the user was not authorized.