Last modified: 2014-02-07 00:37:47 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 46482 - GitInfo.php (used by Special:Version) should use DIRECTORY_SEPARATOR (PHP defined constant) instead of hardcoded "/"
GitInfo.php (used by Special:Version) should use DIRECTORY_SEPARATOR (PHP def...
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Special pages (Other open bugs)
1.21.x
All All
: Normal normal (vote)
: ---
Assigned To: Tony Thomas
: easy
Depends on:
Blocks: code_quality
  Show dependency treegraph
 
Reported: 2013-03-23 09:18 UTC by T. Gries
Modified: 2014-02-07 00:37 UTC (History)
4 users (show)

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


Attachments

Description T. Gries 2013-03-23 09:18:41 UTC
I discovered that GitInfo.php still uses hardcoded directory path separators.

In my view it should better use system independent constant DIRECTORY_PATH instead of hardcoded "/".
Comment 1 Daniel Friesen 2013-03-23 09:26:15 UTC
You might want to make a general bug about that. Practically the entirety of core hardcodes /s.

For all the path stuff we do we have a grand total of 12 uses of DIRECTORY_PATH inside of core. And 9 of them are in GlobalSettings. The last three files only use it once.
Comment 2 Tony Thomas 2014-02-05 10:07:36 UTC
Is DIRECTORY_PATH variable an already defined one ?
should changing GitInfo.php#L53 
$this->basedir = $isAbsolute ? $path : "{$dir}/{$path}"; 
to
$this->basedir = $isAbsolute ? $path : "{$dir}".DIRECTORY_PATH."{$path}";
or sth similar do the trick ?
Comment 3 T. Gries 2014-02-05 11:14:17 UTC
(In reply to comment #2)
> Is DIRECTORY_PATH variable an already defined one ?

What I meant was: use the PHP-built-in constant DIRECTORY_SEPARATOR (string)  see http://us3.php.net/manual/dir.constants.php
Comment 4 Tony Thomas 2014-02-06 14:58:11 UTC
I have made a draft. Can you go through this and check whether its the right way to do it ?
https://gerrit.wikimedia.org/r/#/c/111777/
Comment 5 Andre Klapper 2014-02-06 15:08:06 UTC
(In reply to comment #4)
> I have made a draft.

Drafts are not public so basically nobody can access them.
Comment 6 Gerrit Notification Bot 2014-02-06 15:18:01 UTC
Change 111777 had a related patch set (by 01tonythomas) published:
Used DIRECTORY_SEPARATOR instead of '/' in GitInfo.php

https://gerrit.wikimedia.org/r/111777
Comment 7 Gerrit Notification Bot 2014-02-07 00:37:11 UTC
Change 111777 merged by jenkins-bot:
Used DIRECTORY_SEPARATOR instead of '/' in GitInfo.php

https://gerrit.wikimedia.org/r/111777

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


Navigation
Links