Skip to content

Convert variable type to int if it was an integer fixes #5688 - #5691

Closed
rfikree92 wants to merge 2 commits into
codeigniter4:developfrom
rfikree92:develop
Closed

Convert variable type to int if it was an integer fixes #5688#5691
rfikree92 wants to merge 2 commits into
codeigniter4:developfrom
rfikree92:develop

Conversation

@rfikree92

@rfikree92 rfikree92 commented Feb 13, 2022

Copy link
Copy Markdown

Fixes #5688

Description
convert any variable that is a number to int type, so errors like #5688 doesn't happen.

Checklist:

  • Securely signed commits
  • Component(s) with PHPDoc blocks, only if necessary or adds value
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

@MGatner MGatner left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inline comment. Also we would need a test to cover this - should be a straightforward adjustment of current tests.

Comment thread system/Config/BaseConfig.php
@kenjis

kenjis commented Feb 13, 2022

Copy link
Copy Markdown
Member

I think the following test cases are needed:

'02471'
'1337e0'
" 42"
"42 "

https://www.php.net/manual/en/function.is-numeric.php#refsect1-function.is-numeric-examples

@kenjis kenjis added the bug Verified issues on the current code behavior or pull requests that will fix them label Feb 13, 2022
@paulbalandan paulbalandan added the tests needed Pull requests that need tests label Feb 15, 2022
@kenjis

kenjis commented Apr 12, 2022

Copy link
Copy Markdown
Member

#5779 was merged.

@kenjis kenjis closed this Apr 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Verified issues on the current code behavior or pull requests that will fix them tests needed Pull requests that need tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Ajax request makes the session expire when app.sessionExpiration is set to 0

4 participants