Skip to content
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

Make sure a value is passed to base64_decode #36693

Merged
merged 5 commits into from
Jun 3, 2022

Conversation

roland-d
Copy link
Contributor

@roland-d roland-d commented Jan 15, 2022

Summary of Changes

When installing a module on PHP 8.1 the following notice is observed in the Network Inspector:
base64_decode(): Passing null to parameter #1 ($string) of type string is deprecated

When the base64 issue is solved you get another notice:
strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated

This happens because there is no return value in the POST request. Not having the return value is absolutely fine but we need to check if it has a value.

This PR fixes that.

Testing Instructions

  1. Make sure you are running PHP 8.1
  2. In the Global Settings set the Error Reporting to maximum
  3. Go to System -> Install -> Extensions
  4. Open the Developer Tools of the browser
  5. Click on the Network tab
  6. Install the attached module
    mod_test.zip
  7. You should see this error
    image
  8. In the Network tab click on the request that just happened
  9. Click on the Response tab
  10. You will see the notice there. If you do not see the notice, you may need to toggle the Raw button
  11. Apply the patch
  12. Install the module again
  13. Click on the Response tab
  14. You will see no notice here

Actual result BEFORE applying this Pull Request

An error is shown due to 8.1 compatibility

Expected result AFTER applying this Pull Request

The 8.1 compatibility is solved.

Documentation Changes Required

None

Signed-off-by: Roland Dalmulder <contact@rolandd.com>
Signed-off-by: Roland Dalmulder <contact@rolandd.com>
@alikon alikon added the PHP 8.x PHP 8.x deprecated issues label Jan 16, 2022
@chmst chmst changed the base branch from 4.0-dev to 4.1-dev January 31, 2022 18:13
@richard67 richard67 added the PBF Pizza, Bugs and Fun label Apr 22, 2022
@Fedik
Copy link
Member

Fedik commented Jun 3, 2022

I have tested this item ✅ successfully on 574fd8e


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/36693.

1 similar comment
@martin-zw
Copy link

I have tested this item ✅ successfully on 574fd8e


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/36693.

@Quy
Copy link
Contributor

Quy commented Jun 3, 2022

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/36693.

@Quy Quy removed the PBF Pizza, Bugs and Fun label Jun 3, 2022
@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Jun 3, 2022
@laoneo laoneo merged commit f0c780e into joomla:4.1-dev Jun 3, 2022
@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label Jun 3, 2022
@laoneo
Copy link
Member

laoneo commented Jun 3, 2022

Thanks!

@laoneo laoneo added this to the Joomla 4.1.5 milestone Jun 3, 2022
Denitz pushed a commit to Denitz/joomla-cms that referenced this pull request Jun 4, 2022
* Make sure a value is passed to base64_decode

Signed-off-by: Roland Dalmulder <contact@rolandd.com>

* Also check if we have a redirect URL before checking it is internal

Signed-off-by: Roland Dalmulder <contact@rolandd.com>
Denitz pushed a commit to Denitz/joomla-cms that referenced this pull request Jun 4, 2022
* Make sure a value is passed to base64_decode

Signed-off-by: Roland Dalmulder <contact@rolandd.com>

* Also check if we have a redirect URL before checking it is internal

Signed-off-by: Roland Dalmulder <contact@rolandd.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PHP 8.x PHP 8.x deprecated issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants