Skip to content

Commit

Permalink
Fix not converted boolean in route::_ and log warning
Browse files Browse the repository at this point in the history
  • Loading branch information
HLeithner committed Jun 16, 2019
1 parent 6c6824f commit 2c5607e
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions libraries/src/Router/Route.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

defined('JPATH_PLATFORM') or die;

use Joomla\CMS\Log\Log;
use Joomla\CMS\Factory;
use Joomla\CMS\Uri\Uri;

Expand Down Expand Up @@ -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))
{
Log::add(
__METHOD__ . '() called with incompatible variable type boolean on parameter $tls.',
Log::WARNING,
'deprecated'
);

if ($tls === true)
{
$tls = self::TLS_FORCE;
}
else
{
$tls = self::TLS_IGNORE;
}
}

$app = Factory::getApplication();
$client = $app->getName();

Expand Down

0 comments on commit 2c5607e

Please sign in to comment.