jenkins-bot has submitted this change and it was merged.

Change subject: XMPValidate: Use ConvertibleTimestamp instead of wfTimestamp()
......................................................................


XMPValidate: Use ConvertibleTimestamp instead of wfTimestamp()

This removes the last MediaWiki dependency in the XMP* classes, and they
can now be moved to libs/ (in a follow up patch).

Change-Id: Iee509fce0e44ec0697e1cdd4cd711846cf35e1e6
---
M includes/media/XMPValidate.php
1 file changed, 4 insertions(+), 2 deletions(-)

Approvals:
  Aaron Schulz: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/media/XMPValidate.php b/includes/media/XMPValidate.php
index fe47f47..32a3340 100644
--- a/includes/media/XMPValidate.php
+++ b/includes/media/XMPValidate.php
@@ -329,13 +329,15 @@
                        // We know that if we got to this step, year, month day 
hour and min must be set
                        // by virtue of regex not failing.
 
-                       $unix = wfTimestamp( TS_UNIX, $res[1] . $res[2] . 
$res[3] . $res[4] . $res[5] . $res[6] );
+                       $unix = ( new ConvertableTimestamp(
+                               $res[1] . $res[2] . $res[3] . $res[4] . $res[5] 
. $res[6]
+                       ) )->getTimestamp( TS_UNIX );
                        $offset = intval( substr( $res[7], 1, 2 ) ) * 60 * 60;
                        $offset += intval( substr( $res[7], 4, 2 ) ) * 60;
                        if ( substr( $res[7], 0, 1 ) === '-' ) {
                                $offset = -$offset;
                        }
-                       $val = wfTimestamp( TS_EXIF, $unix + $offset );
+                       $val = ( new ConvertableTimestamp( $unix + $offset ) 
)->getTimestamp( TS_EXIF );
 
                        if ( $stripSeconds ) {
                                // If seconds weren't specified, remove the 
trailing ':00'.

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Iee509fce0e44ec0697e1cdd4cd711846cf35e1e6
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Legoktm <legoktm.wikipe...@gmail.com>
Gerrit-Reviewer: Aaron Schulz <asch...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to