Fix not converted boolean in route::_ and log warning#25225
Fix not converted boolean in route::_ and log warning#25225SniperSister merged 7 commits intojoomla:stagingfrom
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
| } | ||
|
|
||
| // @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.
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.