protected function checkPrivacy($level = PRIVACY_PUBLIC)
{
$privacy = null;
$arg1 = JRequest::getVar('arg1');
$arg1 = json_decode($arg1);
$args = rawurldecode($arg1[1]);
$args = json_decode($args);
if (isset($args->privacy)) // JomSocial < 3.2(?) way
$privacy = $args->privacy;
else // JomSocial 3.2+ way
{
$arg3raw = JRequest::getVar('arg3');
$arg3filtered = substr($arg3raw, strpos($arg3raw, '{'), strpos($arg3raw, '}') - strpos($arg3raw, '{') + 1);
$arg3 = json_decode($arg3filtered);
if (isset($arg3->privacy))
$privacy = $arg3->privacy;
}
if ($privacy && ($privacy <= $level))
return true;
else
return false;
}
Join our newsletter to get alerts for Joomla releases, tips and tricks and extension updates.