Last modified: 2011-12-10 19:17:16 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T32172, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 30172 - posix_isatty() check insufficient?
posix_isatty() check insufficient?
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Maintenance scripts (Other open bugs)
unspecified
All All
: Normal normal (vote)
: ---
Assigned To: Chad H.
: patch
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-08-02 00:40 UTC by Chad H.
Modified: 2011-12-10 19:17 UTC (History)
4 users (show)

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


Attachments
posix_isatty() patch (3.38 KB, patch)
2011-08-02 15:11 UTC, Chad H.
Details

Description Chad H. 2011-08-02 00:40:39 UTC
As reported on IRC:
$ php /var/www/mediawiki/maintenance/update.php
PHP Fatal error:  Cannot redeclare posix_isatty() in /var/www/mediawiki/maintenance/Maintenance.php on line 27

Weird, since posix_isatty() should be wrapped in a function_exists() check.
Comment 1 Brion Vibber 2011-08-02 09:13:08 UTC
IIRC it's actually possible to disable functions from php.ini, in which case they don't turn up on function_exists() but you can't redeclare them. (Reflection may do better at finding them to confirm existence.)

Of course this'd be a pretty weird thing to disable...
Comment 2 Chad H. 2011-08-02 15:11:56 UTC
Created attachment 8874 [details]
posix_isatty() patch

Rather than doing a conditional function define (which HipHop won't like anyway), I just threw it in a wrapper method in Maintenance. Nothing in extensions calls this--and few core maintenance scripts even do--so the impact should be minimal.

Just asking for a quick sanity check that this will work as intended.
Comment 3 Dan Collins 2011-08-02 18:08:40 UTC
That patch looks plenty sane, Chad, should work as intended. I feel bad about the !$fd hack, but that's just the part of me that wants to be a good person and have readable code ;)
+reviewed
Comment 4 Chad H. 2011-08-02 22:02:17 UTC
Done in r30172.
Comment 5 Dan Collins 2011-08-02 22:15:02 UTC
I think you mean r93789. If not, I'm wondering where you found the time machine?
Comment 6 Tim De Baets 2011-12-10 19:17:16 UTC
Would it be possible to backport this to 1.18? I'm currently unable to upgrade my wiki because of this bug. Thanks.

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


Navigation
Links