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
Fix not converted boolean in route::_ and log warning #25225
Conversation
@HLeithner It seems you mixed up texts for "Expected result" and "Actual result" in your description. "Expected result" should describe result with this PR applied, "Actual result" should describe result of current staging, i.e. without this PR applied. |
libraries/src/Router/Route.php
Outdated
@@ -74,6 +75,25 @@ public static function _($url, $xhtml = true, $tls = self::TLS_IGNORE, $absolute | |||
$tls = self::TLS_DISABLE; | |||
} | |||
|
|||
// @deprecated 4.0 Before 3.9.7 this method silently converted boolean to integer | |||
if (is_bool($tls)) |
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 is unnecessary, IMO. Strings and even arrays worked here too until recently. But argument has been documented as integer since at least 1.5.
@SharkyKZ you are right it's unnecessary anyway I changed it to convert all variables to int. |
Just noticed this is in |
For me it's only a pre Joomla 3.9 thing (and should be removed in j4) because Route::link added in this version but I'm still not sure to add it as you already stated the documentation says it's an integer. |
I have tested this item ✅ successfully on 955c92a This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/25225. |
I have tested this item ✅ successfully on 955c92a This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/25225. |
RTC This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/25225. |
Pull Request for Issue #25204 .
Summary of Changes
Added boolean conversion removed in pr #24089, also log a warning if wrong parameter type is used. Should be removed with J4.
Testing Instructions
use jroute::_ with $tls parameter as int and boolean (true/false)
Expected result
Now we convert it if type is Boolean.
Actual result
Boolean didn't got converted to 0 or 1.