Jump to content

Module:Citation/CS1: Difference between revisions

fix archive_url_check();
m>Trappist the monk
No edit summary
m>Trappist the monk
(fix archive_url_check();)
Line 1,676: Line 1,676:
table.insert( z.message_tail, { set_error( 'archive_url', {'save command'}, true ) } ); -- add error message
table.insert( z.message_tail, { set_error( 'archive_url', {'save command'}, true ) } ); -- add error message
return '', ''; -- return empty strings for archiveURL and ArchiveDate
return '', ''; -- return empty strings for archiveURL and ArchiveDate
elseif url:match('//web\.archive\.org/web/%d%d%d%d%d%d%d%d%d%d%d%d%d%d/') then -- if there is what looks like a correct timestamp
elseif url:match('//web\.archive\.org/web/%d%d%d%d%d%d%d%d%d%d%d%d%d%d/') or -- if there is what looks like a correct timestamp
return url, date; -- return archiveURL and ArchiveDate
url:match('//web\.archive\.org/%d%d%d%d%d%d%d%d%d%d%d%d%d%d/') then -- without /web/ gets remapped to have the /web/ by archive.org
return url, date; -- return archiveURL and ArchiveDate
else -- malformed url
else -- malformed url
table.insert( z.message_tail, { set_error( 'archive_url', {'timestamp'}, true ) } ); -- add error message
table.insert( z.message_tail, { set_error( 'archive_url', {'timestamp'}, true ) } ); -- add error message
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.