Last modified: 2014-10-19 10:09:05 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 17642 - Add closing PHP tags to end of all files
Add closing PHP tags to end of all files
Status: CLOSED WONTFIX
Product: MediaWiki
Classification: Unclassified
General/Unknown (Other open bugs)
1.14.x
All All
: Lowest trivial (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-02-23 22:17 UTC by Dan Jacobson
Modified: 2014-10-19 10:09 UTC (History)
6 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Dan Jacobson 2009-02-23 22:17:04 UTC
It would be best if all PHP files matched their opening tag with a proper closing tag at the end:
<?php
  //bla
?>
including even the generated LocalSettings.php.

While not required, it would demonstrate well-formedness.
Comment 1 Robert Leverington 2009-02-23 22:22:20 UTC
They were removed to avoid accidental whitespace issues, they will not be added back - they offer no additional functionality.
Comment 3 Dan Jacobson 2009-03-17 21:28:07 UTC
Well OK, but you never know. Look what bash is doing these days, suddenly printing lots of warnings:
line 261: warning: here-document at line 253 delimited by end-of-file (wanted `EOF')

OK, easy enough to fix when the time comes...
...if one has permissions to update all components.
Comment 4 Tim Starling 2009-03-17 21:35:39 UTC
Official Zend coding style is to omit the closing tags, for the same reason we do. It's unlikely they would change the parser so as to break their own code.
Comment 5 Aryeh Gregor (not reading bugmail, please e-mail directly) 2009-03-17 21:42:10 UTC
(In reply to comment #3)
> Well OK, but you never know. Look what bash is doing these days, suddenly
> printing lots of warnings:
> line 261: warning: here-document at line 253 delimited by end-of-file (wanted
> `EOF')

What file is that in?  Here-documents shouldn't be terminated by end-of-file.  If we removed the ?> tags, this error would still occur, just the "?>" would be included in the string . . .
Comment 6 Tim Starling 2009-03-17 21:44:24 UTC
(In reply to comment #5)
> (In reply to comment #3)
> > Well OK, but you never know. Look what bash is doing these days, suddenly
> > printing lots of warnings:
> > line 261: warning: here-document at line 253 delimited by end-of-file (wanted
> > `EOF')
> 
> What file is that in?  Here-documents shouldn't be terminated by end-of-file. 
> If we removed the ?> tags, this error would still occur, just the "?>" would be
> included in the string . . .
> 

He's complaining about bash, not PHP, and about some unrelated script, not about MediaWiki.
Comment 7 Aryeh Gregor (not reading bugmail, please e-mail directly) 2009-03-17 21:48:35 UTC
Oh, right.
Comment 8 Dan Jacobson 2009-03-17 21:53:13 UTC
No, I was saying: forget your closing ?>'s in php, and end up like the
folks who forgot their closing EOFs in bash (will very soon): one day
the webhost updates bash and all your programs start printing warnings
before you can return from Hawaii to figure out what your readers are
complaining about.

I forgot that PHP also has here documents in addition to ?>, sorry for
the confusion.

Of course I don't even know how to spell PHP, so don't quote me.
Comment 9 Roan Kattouw 2009-03-17 21:55:53 UTC
(In reply to comment #8)
> No, I was saying: forget your closing ?>'s in php, and end up like the
> folks who forgot their closing EOFs in bash (will very soon): one day
> the webhost updates bash and all your programs start printing warnings
> before you can return from Hawaii to figure out what your readers are
> complaining about.
> 
First of all, PHP warnings aren't ever shown to visitors if your wiki is configured right, they'll just clutter the error log.

And to explain why this will probably never cause warnings, I'll reply with a quote:

(In reply to comment #4)
> Official Zend coding style is to omit the closing tags, for the same reason we
> do. It's unlikely they would change the parser so as to break their own code.
> 

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links