@scroom, @copylefter, @lagoon24,
Apologies for this. Per WordPress Coding Standards we are encouraged to end each line with a comma in multiline array notation. In the new excerpt function with footnotes, some function calls are so long I’ve ended up breaking them in lines, then unfortunately added those commas.
This article https://laravel-news.com/php-trailing-commas-functions published in June?2018 states that “PHP 7.3 won’t have arrow functions (that would be dreamy). However, trailing commas in function calls is an excellent addition coming to PHP 7.3. In PHP 7.3, trailing commas in function calls will be valid syntax. That is to say, you can use trailing commas when calling functions, but not defining them. Trailing commas in function calls are specifically useful for variadic functions: [examples] Importantly, this change only affects call syntax, not function declaration!”
I definitely call the functions:
// Safeguard the footnotes.
preg_match_all(
'#' . self::$a_str_start_tag_regex . '.+?' . self::$a_str_end_tag_regex . '#',
$p_str_content,
$p_arr_saved_footnotes,
);
Also the next:
// Prevent the footnotes from altering the excerpt: previously hard-coded '5ED84D6'.
$l_int_placeholder = '@' . mt_rand( 100000000, 2147483647 ) . '@';
$p_str_content = preg_replace(
'#' . self::$a_str_start_tag_regex . '.+?' . self::$a_str_end_tag_regex . '#',
$l_int_placeholder,
$p_str_content,
);
And below too:
// Readd footnotes in excerpt.
$l_int_index = 0;
while ( 0 !== preg_match( '#' . $l_int_placeholder . '#', $p_str_content ) ) {
$p_str_content = preg_replace(
'#' . $l_int_placeholder . '#',
$p_arr_saved_footnotes[0][ $l_int_index ],
$p_str_content,
1,
);
$l_int_index++;
}
These three commas have now been removed, and v2.6.4 released in urgency.
I’m sad about screwing things up, and since three months I tried to hand the plugin over to experienced programmers, after failing the first time when @misfist was perhaps ready to relay me. Because I really joined in only because there were so many bugs in a plugin that I considered indispensable. Months ago I just customized it to get it to work, and documented the fixes for others to use the patches.
So I’ll be careful with commas when calling functions.
Sorry again!
-
This reply was modified 3 years, 7 months ago by pewgeuges.