Enable back references in reg exp in BBCode::convert

- Bump BBCode version
2022.09-rc
Hypolite Petovan 2020-12-06 08:57:06 -05:00
rodzic f141f5acf4
commit e6270bc46d
1 zmienionych plików z 2 dodań i 2 usunięć

Wyświetl plik

@ -50,7 +50,7 @@ use Friendica\Util\XML;
class BBCode class BBCode
{ {
// Update this value to the current date whenever changes are made to BBCode::convert // Update this value to the current date whenever changes are made to BBCode::convert
const VERSION = '2020-12-03'; const VERSION = '2020-12-06';
const INTERNAL = 0; const INTERNAL = 0;
const API = 2; const API = 2;
@ -1852,7 +1852,7 @@ class BBCode
}); // Escaped noparse, nobb, pre }); // Escaped noparse, nobb, pre
// Remove escaping tags and replace new lines that remain // Remove escaping tags and replace new lines that remain
$text = preg_replace_callback("/\[(noparse|nobb)\](.*?)\[\/\1\]/ism", function ($match) { $text = preg_replace_callback('/\[(noparse|nobb)](.*?)\[\/\1]/ism', function ($match) {
return str_replace("\n", "<br>", $match[2]); return str_replace("\n", "<br>", $match[2]);
}, $text); }, $text);