>'; // should be impossible to match if(is_array($groups) && count($groups)) { foreach($groups as $g) $gs .= '|<' . intval($g) . '>'; } $sql = sprintf( " AND ( allow_cid = '' OR allow_cid REGEXP '<%d>' ) AND ( deny_cid = '' OR NOT deny_cid REGEXP '<%d>' ) AND ( allow_gid = '' OR allow_gid REGEXP '%s' ) AND ( deny_gid = '' OR NOT deny_gid REGEXP '%s') ", intval($remote_user), intval($remote_user), dbesc($gs), dbesc($gs) ); } } return $sql; }