Topic on Extension talk:QRCodeOnLoad

Summary by Kghbln

Do not add a trailing ?> to your code.

Kramer~mediawikiwiki (talkcontribs)

I have added a trailing php close tag ?> which is required to run this software. User User:Jack_Phoenix has reverted this edit, (perhaps by mistake?) but I plan to revert back. Please Jack_Phoenix let me know your rational for reverting.

This post was posted by Kramer~mediawikiwiki, but signed as Kramer.

Jack Phoenix (talkcontribs)

No, was not a mistake, but a very intentional change.

The PHP trailing ?> has been considered harmful since 2007 (see r23531 for some more details) and it is not needed in pure PHP files. (Obviously it is needed if you mix, say, HTML and PHP via something like QuickTemplate, for example.) Since 2009, MediaWiki.org has had an AbuseFilter in place to tag edits in which users add that unnecessary closing tag. Perhaps that filter should also display a warning message?

So yes, let's not add the PHP closing tag unless it's really necessary which, by the way, it isn't in most cases. :-)