Skip to content

Instantly share code, notes, and snippets.

@mbriceno
Created October 23, 2012 01:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mbriceno/3936194 to your computer and use it in GitHub Desktop.
Save mbriceno/3936194 to your computer and use it in GitHub Desktop.
public static function makeId()
{
$app = JFactory::getApplication();
// Get url parameters set by plugins
if(!empty($app->registeredurlparams))
{
$registeredurlparams = $app->registeredurlparams;
}
// Platform defaults
$registeredurlparams->format = 'WORD';
$registeredurlparams->option = 'WORD';
$registeredurlparams->view = 'WORD';
$registeredurlparams->layout = 'WORD';
$registeredurlparams->tpl = 'CMD';
$registeredurlparams->id = 'INT';
$safeuriaddon = new stdClass;
foreach ($registeredurlparams as $key => $value)
{
$safeuriaddon->$key = JRequest::getVar($key, null, 'default', $value);
}
return md5(serialize($safeuriaddon));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment