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 "prop=duplicatefiles does not show duplicates under same name"
[lhc/web/wiklou.git]
/
includes
/
MagicWord.php
diff --git
a/includes/MagicWord.php
b/includes/MagicWord.php
index
9745b9a
..
42791f5
100644
(file)
--- a/
includes/MagicWord.php
+++ b/
includes/MagicWord.php
@@
-24,7
+24,7
@@
*/
/**
*/
/**
- * This class encapsulates "magic words" such as
#redirect
, __NOTOC__, etc.
+ * This class encapsulates "magic words" such as
"#redirect"
, __NOTOC__, etc.
*
* @par Usage:
* @code
*
* @par Usage:
* @code
@@
-42,7
+42,7
@@
*
* To add magic words in an extension, use $magicWords in a file listed in
* $wgExtensionMessagesFiles[].
*
* To add magic words in an extension, use $magicWords in a file listed in
* $wgExtensionMessagesFiles[].
- *
+ *
* @par Example:
* @code
* $magicWords = array();
* @par Example:
* @code
* $magicWords = array();
@@
-299,6
+299,7
@@
class MagicWord {
* Initialises this object with an ID
*
* @param $id
* Initialises this object with an ID
*
* @param $id
+ * @throws MWException
*/
function load( $id ) {
global $wgContLang;
*/
function load( $id ) {
global $wgContLang;
@@
-645,6
+646,9
@@
class MagicWordArray {
var $baseRegex, $regex;
var $matches;
var $baseRegex, $regex;
var $matches;
+ /**
+ * @param $names array
+ */
function __construct( $names = array() ) {
$this->names = $names;
}
function __construct( $names = array() ) {
$this->names = $names;
}
@@
-772,6
+776,14
@@
class MagicWordArray {
return $newRegex;
}
return $newRegex;
}
+ /**
+ * @since 1.20
+ * @return array
+ */
+ public function getNames() {
+ return $this->names;
+ }
+
/**
* Parse a match array from preg_match
* Returns array(magic word ID, parameter value)
/**
* Parse a match array from preg_match
* Returns array(magic word ID, parameter value)
@@
-779,6
+791,7
@@
class MagicWordArray {
*
* @param $m array
*
*
* @param $m array
*
+ * @throws MWException
* @return array
*/
function parseMatch( $m ) {
* @return array
*/
function parseMatch( $m ) {
@@
-815,7
+828,7
@@
class MagicWordArray {
$regexes = $this->getVariableStartToEndRegex();
foreach ( $regexes as $regex ) {
if ( $regex !== '' ) {
$regexes = $this->getVariableStartToEndRegex();
foreach ( $regexes as $regex ) {
if ( $regex !== '' ) {
- $m =
false
;
+ $m =
array()
;
if ( preg_match( $regex, $text, $m ) ) {
return $this->parseMatch( $m );
}
if ( preg_match( $regex, $text, $m ) ) {
return $this->parseMatch( $m );
}