Jarves\ACL::normalizeCode PHP Method

normalizeCode() public method

self::removeAcl($pType, $pTargetType, $pTargetId, $pCode); if ($pWithSub) $pCode .= '%'; $pCode = '[' . implode(',', $pActions) . ']'; $last_id = dbInsert('system_acl', array( 'type' => $pType, 'target_type' => $pTargetType, 'target_id' => $pTargetId, 'code' => $pCode )); $this->cache[$pType] = null; return $last_id; } public function remove($pType, $pTargetType, $pTargetId, $pCode) { self::normalizeCode($pCode); $pType += 0; $pTargetType += $pTargetType; $pTargetId += $pTargetId; $pCode = esc($pCode); dbDelete('system_acl', "1=1 AND type = $pType AND target_type = $pTargetType AND target_id = $pTargetId AND code LIKE '$pCode%'"); $this->cache[$pType] = null; }
public normalizeCode ( &$code )
    public function normalizeCode(&$code)
    {
        $code = str_replace('//', '/', $code);
        if (substr($code, 0, 1) !== '/') {
            $code = '/' . $code;
        }
        if (substr($code, -1) === '/') {
            $code = substr($code, 0, -1);
        }
    }