Skip to content

Commit

Permalink
Rename BBCode::removeAbstract() to BBCode::stripAbstract()
Browse files Browse the repository at this point in the history
  • Loading branch information
Hypolite Petovan committed Feb 5, 2018
1 parent ddcbe75 commit d75bb8e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/Content/Text/BBCode.php
Expand Up @@ -355,7 +355,7 @@ public static function toPlaintext($b, $limit = 0, $includedlinks = false, $html
$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
Expand Down Expand Up @@ -1380,7 +1380,7 @@ public static function convert($text, $preserve_nl = false, $try_oembed = true,
$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);
Expand Down Expand Up @@ -1941,12 +1941,12 @@ function ($match) use ($simple_html) {
}

/**
* @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);
Expand Down
2 changes: 1 addition & 1 deletion src/Protocol/DFRN.php
Expand Up @@ -930,7 +930,7 @@ private static function entry($doc, $type, $item, $owner, $comment = false, $cid
}

// Remove the abstract element. It is only locally important.
$body = BBCode::removeAbstract($body);
$body = BBCode::stripAbstract($body);

if ($type == 'html') {
$htmlbody = $body;
Expand Down

0 comments on commit d75bb8e

Please sign in to comment.