Created
July 26, 2011 20:39
-
-
Save aboutwout/1107952 to your computer and use it in GitHub Desktop.
Super secret EE code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// /system/expressionengine/libraries/Template.php (line 3030) | |
// Member Group in_group('1') function, Super Secret! Shhhhh! | |
if (preg_match_all("/in_group\(([^\)]+)\)/", $str, $matches)) | |
{ | |
$groups = (is_array($this->EE->session->userdata['group_id'])) ? $this->EE->session->userdata['group_id'] : array($this->EE->session->userdata['group_id']); | |
for($i=0, $s=count($matches[0]); $i < $s; ++$i) | |
{ | |
$check = explode('|', str_replace(array('"', "'"), '', $matches[1][$i])); | |
$str = str_replace($matches[0][$i], (count(array_intersect($check, $groups)) > 0) ? 'TRUE' : 'FALSE', $str); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment