Module:Protection banner: Difference between revisions

Content added Content deleted
Enwikipedia>Mr. Stradivarius
(make the variable names a little more descriptive)
Enwikipedia>Mr. Stradivarius
(use a comment instead of a variable assignment to make it clear that protectionObj is the error message)
Line 809: Line 809:
)
)
if not protectionObjCreated then
if not protectionObjCreated then
local errorMessage = protectionObj
local errorBlurb = cfg.msg['error-message-blurb'] or 'Error: $1.'
local errorBlurb = cfg.msg['error-message-blurb'] or 'Error: $1.'
local errorText = mw.message.newRawMessage(errorBlurb):params(errorMessage):plain()
local errorText = mw.message.newRawMessage(errorBlurb)
:params(protectionObj) -- protectionObj is the error message
:plain()
return string.format(
return string.format(
'<strong class="error">%s</strong>',
'<strong class="error">%s</strong>',