@@ -69,7 +69,7 @@ public static function parseVer( $str ) {
69
69
*/
70
70
public static function parseCSV ( &$ param ) {
71
71
$ REGEX_CSV = '/\s*,\s*/ ' ;
72
- $ ret = preg_split ( $ REGEX_CSV , $ param , null , PREG_SPLIT_NO_EMPTY );
72
+ $ ret = preg_split ( $ REGEX_CSV , $ param , - 1 , PREG_SPLIT_NO_EMPTY );
73
73
if ( count ( $ ret ) == 1 ) {
74
74
return $ ret [0 ];
75
75
} else {
@@ -80,27 +80,27 @@ public static function parseCSV( &$param ) {
80
80
/**
81
81
* Parses a wikitext string into an array of lines.
82
82
*
83
- * @param string &$param The string to split.
83
+ * @param ? string &$param The string to split.
84
84
* @param bool $escape_percents Keep literal percent signs for a printf format string.
85
85
* @return array Array of lines.
86
86
*/
87
87
public static function parseLines ( &$ param , $ escape_percents = true ) {
88
88
$ REGEX_LINE = '#<br\s*/?>|\n# ' ;
89
89
90
90
// Important! Breaks patch stacking otherwise!
91
- if ( strlen ( $ param ) == 0 ) {
91
+ if ( ( $ param === null ) || ( strlen ( $ param ) == 0 ) ) {
92
92
return null ;
93
93
}
94
94
$ param = TPCUtil::sanitize ( $ param , $ escape_percents );
95
95
$ tlnotePos = strpos ( $ param , json_decode ( '"\u0014" ' ) );
96
96
if ( $ tlnotePos !== FALSE ) {
97
97
$ tlnote = substr ( $ param , $ tlnotePos );
98
98
$ regular = substr ( $ param , 0 , $ tlnotePos );
99
- $ ret = preg_split ( $ REGEX_LINE , $ regular, null ) ;
99
+ $ ret = preg_split ( $ REGEX_LINE , $ regular ) ;
100
100
$ ret [ count ($ ret ) - 1 ] .= preg_replace ("#<br\s*/?># " , "" , $ tlnote );
101
101
return $ ret ;
102
102
}
103
- return preg_split ( $ REGEX_LINE , $ param, null );
103
+ return preg_split ( $ REGEX_LINE , $ param );
104
104
}
105
105
106
106
/**
0 commit comments