Module:Protection banner: Difference between revisions

    (add a Blurb:_makeIntroFragmentParameter function to get round the problem of how to deal with commas in run-on sentences using the INTROBLURB parameter)
    (make Protection:needsExpiry even more complicated to allow for trinary logic in cfg.expiryCheckActions)
    Line 301: Line 301:
    function Protection:needsExpiry()
    function Protection:needsExpiry()
    local cfg = self._cfg
    local cfg = self._cfg
    return not self.expiry
    local actionNeedsCheck = cfg.expirycheckactions[self.action]
    and cfg.expiryCheckActions[self.action]
    return not self.expiry and (
    and self.reason -- the old {{pp-protected}} didn't check for expiry
    actionNeedsCheck or (
    and not cfg.reasonsWithoutExpiryCheck[self.reason]
    actionNeedsCheck == nil
    and self.reason -- the old {{pp-protected}} didn't check for expiry
    and not cfg.reasonsWithoutExpiryCheck[self.reason]
    )
    )
    end
    end