Rename BBCode::removeAbstract() to BBCode::stripAbstract()

This commit is contained in:
Hypolite Petovan 2018-02-04 23:38:40 -05:00
parent ddcbe75f15
commit d75bb8e970
2 changed files with 5 additions and 5 deletions

View File

@ -355,7 +355,7 @@ class BBCode
$body = preg_replace("/([^\]\='".'"'."]|^)(https?\:\/\/[a-zA-Z0-9\:\/\-\?\&\;\.\=\_\~\#\%\$\!\+\,]+)/ism", '$1[url]$2[/url]', $body);
// Remove the abstract
$body = self::removeAbstract($body);
$body = self::stripAbstract($body);
// At first look at data that is attached via "type-..." stuff
// This will hopefully replaced with a dedicated bbcode later
@ -1380,7 +1380,7 @@ class BBCode
$text = preg_replace_callback("/\[pre\](.*?)\[\/pre\]/ism", 'self::escapeNoparseCallback', $text);
// Remove the abstract element. It is a non visible element.
$text = self::removeAbstract($text);
$text = self::stripAbstract($text);
// Move all spaces out of the tags
$text = preg_replace("/\[(\w*)\](\s*)/ism", '$2[$1]', $text);
@ -1941,12 +1941,12 @@ class BBCode
}
/**
* @brief Removes the "abstract" element from the text
* @brief Strips the "abstract" tag from the provided text
*
* @param string $text The text with BBCode
* @return string The same text - but without "abstract" element
*/
public static function removeAbstract($text)
public static function stripAbstract($text)
{
$text = preg_replace("/[\s|\n]*\[abstract\].*?\[\/abstract\][\s|\n]*/ism", '', $text);
$text = preg_replace("/[\s|\n]*\[abstract=.*?\].*?\[\/abstract][\s|\n]*/ism", '', $text);

View File

@ -930,7 +930,7 @@ class DFRN
}
// Remove the abstract element. It is only locally important.
$body = BBCode::removeAbstract($body);
$body = BBCode::stripAbstract($body);
if ($type == 'html') {
$htmlbody = $body;