|
@@ -98,8 +98,12 @@ class PostFormatter{
|
|
|
|
|
|
public static function CloseOpenTag($str){
|
|
|
$matches=array();
|
|
|
- preg_match_all('@.*\[([a-z]*) ?.*?\]@ms', $str, $matches);
|
|
|
+ preg_match_all('@.*\[([a-z]*) ?[^/]*?\](.*)$@ms', $str, $matches); //(?![\[/\1\]])
|
|
|
+
|
|
|
+ if (count($matches[0])==0 || preg_match_all('@\[/'.$matches[1][0].'\]@', $matches[2][0])>0)
|
|
|
+ return $str;
|
|
|
+
|
|
|
$closeTag='[/'.$matches[1][0].']';
|
|
|
- return $str.PHP_EOL.'...'.PHP_EOL.$closeTag;
|
|
|
+ return $str.PHP_EOL.$closeTag;
|
|
|
}
|
|
|
}
|