summaryrefslogtreecommitdiff
path: root/includes/StringUtils.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2011-06-22 11:28:20 +0200
committerPierre Schmitz <pierre@archlinux.de>2011-06-22 11:28:20 +0200
commit9db190c7e736ec8d063187d4241b59feaf7dc2d1 (patch)
tree46d1a0dee7febef5c2d57a9f7b972be16a163b3d /includes/StringUtils.php
parent78677c7bbdcc9739f6c10c75935898a20e1acd9e (diff)
update to MediaWiki 1.17.0
Diffstat (limited to 'includes/StringUtils.php')
-rw-r--r--includes/StringUtils.php29
1 files changed, 17 insertions, 12 deletions
diff --git a/includes/StringUtils.php b/includes/StringUtils.php
index 0be88df5..c1e617a0 100644
--- a/includes/StringUtils.php
+++ b/includes/StringUtils.php
@@ -36,7 +36,11 @@ class StringUtils {
* This implementation is slower than hungryDelimiterReplace but uses far less
* memory. The delimiters are literal strings, not regular expressions.
*
- * @param string $flags Regular expression flags
+ * @param $startDelim String: start delimiter
+ * @param $endDelim String: end delimiter
+ * @param $callback Callback: function to call on each match
+ * @param $subject String
+ * @param $flags String: regular expression flags
*/
# If the start delimiter ends with an initial substring of the end delimiter,
# e.g. in the case of C-style comments, the behaviour differs from the model
@@ -115,17 +119,18 @@ class StringUtils {
return $output;
}
- /*
+ /**
* Perform an operation equivalent to
*
* preg_replace( "!$startDelim(.*)$endDelim!$flags", $replace, $subject )
*
- * @param string $startDelim Start delimiter regular expression
- * @param string $endDelim End delimiter regular expression
- * @param string $replace Replacement string. May contain $1, which will be
- * replaced by the text between the delimiters
- * @param string $subject String to search
- * @return string The string with the matches replaced
+ * @param $startDelim String: start delimiter regular expression
+ * @param $endDelim String: end delimiter regular expression
+ * @param $replace String: replacement string. May contain $1, which will be
+ * replaced by the text between the delimiters
+ * @param $subject String to search
+ * @param $flags String: regular expression flags
+ * @return String: The string with the matches replaced
*/
static function delimiterReplace( $startDelim, $endDelim, $replace, $subject, $flags = '' ) {
$replacer = new RegexlikeReplacer( $replace );
@@ -136,8 +141,8 @@ class StringUtils {
/**
* More or less "markup-safe" explode()
* Ignores any instances of the separator inside <...>
- * @param string $separator
- * @param string $text
+ * @param $separator String
+ * @param $text String
* @return array
*/
static function explodeMarkup( $separator, $text ) {
@@ -163,8 +168,8 @@ class StringUtils {
* Escape a string to make it suitable for inclusion in a preg_replace()
* replacement parameter.
*
- * @param string $string
- * @return string
+ * @param $string String
+ * @return String
*/
static function escapeRegexReplacement( $string ) {
$string = str_replace( '\\', '\\\\', $string );