/**
* Create a safe ID for cached data from URL parameters
*
* @return string MD5 encoded cache ID
*
* @since 1.7.0
*/
public static function makeId()
{
$app = Factory::getApplication();
$registeredurlparams = new \stdClass();
// Get url parameters set by plugins
if (!empty($app->registeredurlparams)) {
$registeredurlparams = $app->registeredurlparams;
}
// Platform defaults
$defaulturlparams = array('format' => 'WORD', 'option' => 'WORD', 'view' => 'WORD', 'layout' => 'WORD', 'tpl' => 'CMD', 'id' => 'INT');
// Use platform defaults if parameter doesn't already exist.
foreach ($defaulturlparams as $param => $type) {
if (!property_exists($registeredurlparams, $param)) {
$registeredurlparams->{$param} = $type;
}
}
$safeuriaddon = new \stdClass();
foreach ($registeredurlparams as $key => $value) {
$safeuriaddon->{$key} = $app->input->get($key, null, $value);
}
return md5(serialize($safeuriaddon));
}