joomla-framework / application

Joomla Framework Application Package
GNU General Public License v2.0
22 stars 30 forks source link

Fix deprecation notice #131

Closed Quy closed 1 month ago

Quy commented 1 month ago

Pull Request for issue #114 and PR #126

Summary of Changes

Do early return for empty $userAgent to all detect methods to fix deprecation warning.

ssabatini commented 2 weeks ago

This does not solve null $userAgent in detectEngine($userAgent) and detectPlatform($userAgent). I would propose to use the solution provided in #124.

richard67 commented 2 weeks ago

This does not solve null $userAgent in detectEngine($userAgent) and detectPlatform($userAgent). I would propose to use the solution provided in #124.

@ssabatini Could you open a new issue for this in this repository so it gets more attention than a comment on a merged pull request? Thanks in advance.

richard67 commented 2 weeks ago

@ssabatini Oh, I just see the CMS issue https://github.com/joomla/joomla-cms/issues/43334 which you had created issue is still open. So maybe it is also sufficient if you comment there.

ssabatini commented 2 weeks ago

@ssabatini Oh, I just see the CMS issue joomla/joomla-cms#43334 which you had created issue is still open. So maybe it is also sufficient if you comment there.

I added my comment to joomla/joomla-cms/#43334 as well.

Quy commented 2 weeks ago

@ssabatini This package has not been upmerged to Joomla. This PR solved null in detectEngine and detectPlatform. Please post the errors in PHP log.

ssabatini commented 1 week ago

Yes, I see that this change is not yet upmerged. As far as I can see, the changes here would solve the problem.

Currently with Joomla 5.2, I still see the following errors for every access with no user agent:

[Fri Nov 08 11:24:18.369249 2024] [fcgid:warn] [pid 599389] [client 52.169.70.154:0] mod_fcgid: stderr: PHP Deprecated:  stripos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /home/httpd/vhosts/cuul.ch/j4x.cuul.ch/libraries/vendor/joomla/application/src/Web/WebClient.php on line 380
[Fri Nov 08 11:24:18.369530 2024] [fcgid:warn] [pid 599389] [client 52.169.70.154:0] mod_fcgid: stderr: PHP Deprecated:  stripos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /home/httpd/vhosts/cuul.ch/j4x.cuul.ch/libraries/vendor/joomla/application/src/Web/WebClient.php on line 380
[Fri Nov 08 11:24:18.369543 2024] [fcgid:warn] [pid 599389] [client 52.169.70.154:0] mod_fcgid: stderr: PHP Deprecated:  stripos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /home/httpd/vhosts/cuul.ch/j4x.cuul.ch/libraries/vendor/joomla/application/src/Web/WebClient.php on line 383
[Fri Nov 08 11:24:18.369549 2024] [fcgid:warn] [pid 599389] [client 52.169.70.154:0] mod_fcgid: stderr: PHP Deprecated:  stripos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /home/httpd/vhosts/cuul.ch/j4x.cuul.ch/libraries/vendor/joomla/application/src/Web/WebClient.php on line 383
[Fri Nov 08 11:24:18.369555 2024] [fcgid:warn] [pid 599389] [client 52.169.70.154:0] mod_fcgid: stderr: PHP Deprecated:  stripos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /home/httpd/vhosts/cuul.ch/j4x.cuul.ch/libraries/vendor/joomla/application/src/Web/WebClient.php on line 385
[Fri Nov 08 11:24:18.369561 2024] [fcgid:warn] [pid 599389] [client 52.169.70.154:0] mod_fcgid: stderr: PHP Deprecated:  stripos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /home/httpd/vhosts/cuul.ch/j4x.cuul.ch/libraries/vendor/joomla/application/src/Web/WebClient.php on line 387
[Fri Nov 08 11:24:18.369567 2024] [fcgid:warn] [pid 599389] [client 52.169.70.154:0] mod_fcgid: stderr: PHP Deprecated:  stripos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /home/httpd/vhosts/cuul.ch/j4x.cuul.ch/libraries/vendor/joomla/application/src/Web/WebClient.php on line 396
[Fri Nov 08 11:24:18.369574 2024] [fcgid:warn] [pid 599389] [client 52.169.70.154:0] mod_fcgid: stderr: PHP Deprecated:  stripos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /home/httpd/vhosts/cuul.ch/j4x.cuul.ch/libraries/vendor/joomla/application/src/Web/WebClient.php on line 396
[Fri Nov 08 11:24:18.369581 2024] [fcgid:warn] [pid 599389] [client 52.169.70.154:0] mod_fcgid: stderr: PHP Deprecated:  stripos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /home/httpd/vhosts/cuul.ch/j4x.cuul.ch/libraries/vendor/joomla/application/src/Web/WebClient.php on line 409
[Fri Nov 08 11:24:18.369598 2024] [fcgid:warn] [pid 599389] [client 52.169.70.154:0] mod_fcgid: stderr: PHP Deprecated:  stripos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /home/httpd/vhosts/cuul.ch/j4x.cuul.ch/libraries/vendor/joomla/application/src/Web/WebClient.php on line 412
[Fri Nov 08 11:24:18.369603 2024] [fcgid:warn] [pid 599389] [client 52.169.70.154:0] mod_fcgid: stderr: PHP Deprecated:  stripos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /home/httpd/vhosts/cuul.ch/j4x.cuul.ch/libraries/vendor/joomla/application/src/Web/WebClient.php on line 412
[Fri Nov 08 11:24:18.369609 2024] [fcgid:warn] [pid 599389] [client 52.169.70.154:0] mod_fcgid: stderr: PHP Deprecated:  stripos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /home/httpd/vhosts/cuul.ch/j4x.cuul.ch/libraries/vendor/joomla/application/src/Web/WebClient.php on line 430
[Fri Nov 08 11:24:18.369615 2024] [fcgid:warn] [pid 599389] [client 52.169.70.154:0] mod_fcgid: stderr: PHP Deprecated:  stripos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /home/httpd/vhosts/cuul.ch/j4x.cuul.ch/libraries/vendor/joomla/application/src/Web/WebClient.php on line 433