Details
Description
Typically encountered with a custom plugin, a GET parameter containing 0 is left out of the array. Consider the following example:
As an example URL:
/admin/plugin/myplugin/admin_forms/fields/0/lookup/51
get[] array contains:
get[0] = lookup
get[1] = 51
However, this example URL works as expected:
/admin/plugin/myplugin/admin_forms/fields/15/lookup/1096
get[] array contains:
get[0] = 15
get[1] = 'lookup'
get[2] = 1096
Basically the value 0 does not exist in the array, but if a non-zero value is provided, it is included in GET.
Jono suggested the following fix:
vendors/minphp/bridge/lib/Router.php around line 330 change
// Only assign GET parameters that are not query parameters if (empty($part) || substr($part, 0, 1) === '?') { continue; }
To
// Only assign GET parameters that are not query parameters if ($part === '' || $part === null || substr($part, 0, 1) === '?') { continue; }
NOTE! Customer stated that this was not sufficient, and suggested the following:
Also had to do something similar near line 276 of same method:
// Begin building URI
for ($i = count($pathParts)1; $i >= 0; $i-) {
//if (!empty($pathParts[$i])) {
if ($pathParts[$i] != '' && $pathParts[$i] != null)
}
So with the edit suggested at line 330 and the edit above near line 276, the 0 is not skipped. I loaded several admin area pages and client area pages following these edits and it does not appear to have broken other pages loading.