mirror of
https://github.com/WordPress/WordPress.git
synced 2025-01-22 16:21:26 +01:00
Add timezone var to IXR_date. Add timezone back to getIso(). Comment WP specific additions. see #7227
git-svn-id: http://svn.automattic.com/wordpress/trunk@8403 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
0ece55eb7d
commit
50269c4845
@ -611,6 +611,7 @@ class IXR_Error {
|
|||||||
var $message;
|
var $message;
|
||||||
function IXR_Error($code, $message) {
|
function IXR_Error($code, $message) {
|
||||||
$this->code = $code;
|
$this->code = $code;
|
||||||
|
// WP adds htmlspecialchars(). See #5666
|
||||||
$this->message = htmlspecialchars($message);
|
$this->message = htmlspecialchars($message);
|
||||||
}
|
}
|
||||||
function getXml() {
|
function getXml() {
|
||||||
@ -650,6 +651,7 @@ class IXR_Date {
|
|||||||
var $hour;
|
var $hour;
|
||||||
var $minute;
|
var $minute;
|
||||||
var $second;
|
var $second;
|
||||||
|
var $timezone;
|
||||||
function IXR_Date($time) {
|
function IXR_Date($time) {
|
||||||
// $time can be a PHP timestamp or an ISO one
|
// $time can be a PHP timestamp or an ISO one
|
||||||
if (is_numeric($time)) {
|
if (is_numeric($time)) {
|
||||||
@ -665,6 +667,8 @@ class IXR_Date {
|
|||||||
$this->hour = date('H', $timestamp);
|
$this->hour = date('H', $timestamp);
|
||||||
$this->minute = date('i', $timestamp);
|
$this->minute = date('i', $timestamp);
|
||||||
$this->second = date('s', $timestamp);
|
$this->second = date('s', $timestamp);
|
||||||
|
// WP adds timezone. See #2036
|
||||||
|
$this->timezone = '';
|
||||||
}
|
}
|
||||||
function parseIso($iso) {
|
function parseIso($iso) {
|
||||||
$this->year = substr($iso, 0, 4);
|
$this->year = substr($iso, 0, 4);
|
||||||
@ -673,9 +677,12 @@ class IXR_Date {
|
|||||||
$this->hour = substr($iso, 9, 2);
|
$this->hour = substr($iso, 9, 2);
|
||||||
$this->minute = substr($iso, 12, 2);
|
$this->minute = substr($iso, 12, 2);
|
||||||
$this->second = substr($iso, 15, 2);
|
$this->second = substr($iso, 15, 2);
|
||||||
|
// WP adds timezone. See #2036
|
||||||
|
$this->timezone = substr($iso, 17);
|
||||||
}
|
}
|
||||||
function getIso() {
|
function getIso() {
|
||||||
return $this->year.$this->month.$this->day.'T'.$this->hour.':'.$this->minute.':'.$this->second;
|
// WP adds timezone. See #2036
|
||||||
|
return $this->year.$this->month.$this->day.'T'.$this->hour.':'.$this->minute.':'.$this->second.$this->timezone;
|
||||||
}
|
}
|
||||||
function getXml() {
|
function getXml() {
|
||||||
return '<dateTime.iso8601>'.$this->getIso().'</dateTime.iso8601>';
|
return '<dateTime.iso8601>'.$this->getIso().'</dateTime.iso8601>';
|
||||||
|
Loading…
Reference in New Issue
Block a user