dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "Make 'quotation-marks' message non-optional"
[lhc/web/wiklou.git]
/
includes
/
parser
/
DateFormatter.php
diff --git
a/includes/parser/DateFormatter.php
b/includes/parser/DateFormatter.php
index
8103b60
..
0a69b04
100644
(file)
--- a/
includes/parser/DateFormatter.php
+++ b/
includes/parser/DateFormatter.php
@@
-156,10
+156,10
@@
class DateFormatter {
}
for ( $i = 1; $i <= self::LAST; $i++ ) {
$this->mSource = $i;
}
for ( $i = 1; $i <= self::LAST; $i++ ) {
$this->mSource = $i;
- if ( isset
( $this->rules[$preference][$i] ) ) {
+ if ( isset( $this->rules[$preference][$i] ) ) {
# Specific rules
$this->mTarget = $this->rules[$preference][$i];
# Specific rules
$this->mTarget = $this->rules[$preference][$i];
- } elseif ( isset
( $this->rules[self::ALL][$i] ) ) {
+ } elseif ( isset( $this->rules[self::ALL][$i] ) ) {
# General rules
$this->mTarget = $this->rules[self::ALL][$i];
} elseif ( $preference ) {
# General rules
$this->mTarget = $this->rules[self::ALL][$i];
} elseif ( $preference ) {
@@
-198,8
+198,9
@@
class DateFormatter {
function replace( $matches ) {
# Extract information from $matches
$linked = true;
function replace( $matches ) {
# Extract information from $matches
$linked = true;
- if ( isset( $this->mLinked ) )
+ if ( isset( $this->mLinked ) )
{
$linked = $this->mLinked;
$linked = $this->mLinked;
+ }
$bits = array();
$key = $this->keys[$this->mSource];
$bits = array();
$key = $this->keys[$this->mSource];
@@
-232,10
+233,12
@@
class DateFormatter {
$fail = false;
// Pre-generate y/Y stuff because we need the year for the <span> title.
$fail = false;
// Pre-generate y/Y stuff because we need the year for the <span> title.
- if ( !isset( $bits['y'] ) && isset( $bits['Y'] ) )
+ if ( !isset( $bits['y'] ) && isset( $bits['Y'] ) )
{
$bits['y'] = $this->makeIsoYear( $bits['Y'] );
$bits['y'] = $this->makeIsoYear( $bits['Y'] );
- if ( !isset( $bits['Y'] ) && isset( $bits['y'] ) )
+ }
+ if ( !isset( $bits['Y'] ) && isset( $bits['y'] ) ) {
$bits['Y'] = $this->makeNormalYear( $bits['y'] );
$bits['Y'] = $this->makeNormalYear( $bits['y'] );
+ }
if ( !isset( $bits['m'] ) ) {
$m = $this->makeIsoMonth( $bits['F'] );
if ( !isset( $bits['m'] ) ) {
$m = $this->makeIsoMonth( $bits['F'] );
@@
-293,8
+296,9
@@
class DateFormatter {
}
$isoBits = array();
}
$isoBits = array();
- if ( isset( $bits['y'] ) )
+ if ( isset( $bits['y'] ) )
{
$isoBits[] = $bits['y'];
$isoBits[] = $bits['y'];
+ }
$isoBits[] = $bits['m'];
$isoBits[] = $bits['d'];
$isoDate = implode( '-', $isoBits );
$isoBits[] = $bits['m'];
$isoBits[] = $bits['d'];
$isoDate = implode( '-', $isoBits );
@@
-312,7
+316,7
@@
class DateFormatter {
*/
function getMonthRegex() {
$names = array();
*/
function getMonthRegex() {
$names = array();
- for( $i = 1; $i <= 12; $i++ ) {
+ for
( $i = 1; $i <= 12; $i++ ) {
$names[] = $this->lang->getMonthName( $i );
$names[] = $this->lang->getMonthAbbreviation( $i );
}
$names[] = $this->lang->getMonthName( $i );
$names[] = $this->lang->getMonthAbbreviation( $i );
}
@@
-353,7
+357,7
@@
class DateFormatter {
*/
function makeNormalYear( $iso ) {
if ( $iso[0] == '-' ) {
*/
function makeNormalYear( $iso ) {
if ( $iso[0] == '-' ) {
- $text = (
intval( substr( $iso, 1 ) ) + 1
) . ' BC';
+ $text = (
intval( substr( $iso, 1 ) ) + 1
) . ' BC';
} else {
$text = intval( $iso );
}
} else {
$text = intval( $iso );
}