Anomie has uploaded a new change for review.

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

Change subject: API: Check return value from $gitInfo->getHeadCommitDate()
......................................................................

API: Check return value from $gitInfo->getHeadCommitDate()

action=query&meta=siteinfo&siprop=extensions calls
$gitInfo->getHeadCommitDate() to attempt to find the commit date, but
does not check whether that function returned false before using the
value. This resulted in displaying the current date for "vcs-date" when
the function failed.

Bug: 64821
Change-Id: Ic39a74abe5160b3b7fbfb7c15323328d6b317560
---
M includes/api/ApiQuerySiteinfo.php
1 file changed, 4 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/69/131469/1

diff --git a/includes/api/ApiQuerySiteinfo.php 
b/includes/api/ApiQuerySiteinfo.php
index b7796ee..b0e9bd2 100644
--- a/includes/api/ApiQuerySiteinfo.php
+++ b/includes/api/ApiQuerySiteinfo.php
@@ -567,7 +567,10 @@
                                                $ret['vcs-system'] = 'git';
                                                $ret['vcs-version'] = 
$vcsVersion;
                                                $ret['vcs-url'] = 
$gitInfo->getHeadViewUrl();
-                                               $ret['vcs-date'] = wfTimestamp( 
TS_ISO_8601, $gitInfo->getHeadCommitDate() );
+                                               $vcsDate = 
$gitInfo->getHeadCommitDate();
+                                               if ( $vcsDate !== false ) {
+                                                       $ret['vcs-date'] = 
wfTimestamp( TS_ISO_8601, $vcsDate );
+                                               }
                                        } else {
                                                $svnInfo = 
SpecialVersion::getSvnInfo( $extensionPath );
                                                if ( $svnInfo !== false ) {

-- 
To view, visit https://gerrit.wikimedia.org/r/131469
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic39a74abe5160b3b7fbfb7c15323328d6b317560
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Anomie <bjor...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to