Skip to content

Commit 90baf34

Browse files
authored
Merge pull request #43 from bkraul/develop
Corrected parser's incompatibility with PHP 5.5.9+
2 parents 8427d29 + 9ce6c51 commit 90baf34

File tree

5 files changed

+8
-7
lines changed

5 files changed

+8
-7
lines changed

BBCodePlus/BBCodePlus.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ function register() {
2424
$this->name = plugin_lang_get( 'title' );
2525
$this->description = plugin_lang_get( 'description' );
2626
$this->page = 'config';
27-
$this->version = '2.1.0';
27+
$this->version = '2.1.1';
2828

2929
$this->requires['MantisCore'] = '2.0.0';
3030
# this plugin can coexist with MantisCoreFormatting.

BBCodePlus/core/BBCodeParser.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ final class BBCodeParser extends Parser
137137
],
138138
];
139139

140-
public function stripTags(string $source): string
140+
public function stripTags($source)
141141
{
142142
foreach ($this->parsers as $name => $parser) {
143143
$source = $this->searchAndReplace($parser['pattern'] . 'i', $parser['content'], $source);
@@ -146,7 +146,7 @@ public function stripTags(string $source): string
146146
return $source;
147147
}
148148

149-
public function parse(string $source, $caseInsensitive = null): string
149+
public function parse($source, $caseInsensitive = null)
150150
{
151151
$caseInsensitive = $caseInsensitive === self::CASE_INSENSITIVE ? true : false;
152152

BBCodePlus/core/HTMLParser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ final class HTMLParser extends Parser
147147
],
148148
];
149149

150-
public function parse(string $source): string
150+
public function parse($source)
151151
{
152152
foreach ($this->parsers as $name => $parser) {
153153
$source = $this->searchAndReplace($parser['pattern'], $parser['replace'], $source);

BBCodePlus/core/Parser.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class Parser
1212

1313
protected $parsers = [];
1414

15-
protected function searchAndReplace(string $pattern, string $replace, string $source): string
15+
protected function searchAndReplace($pattern, $replace, $source)
1616
{
1717
while (preg_match($pattern, $source)) {
1818
$source = preg_replace($pattern, $replace, $source);
@@ -39,7 +39,7 @@ public function except($except = null)
3939
return $this;
4040
}
4141

42-
public function addParser(string $name, string $pattern, string $replace, string $content)
42+
public function addParser($name, $pattern, $replace, $content)
4343
{
4444
$this->parsers = array_merge($this->parsers, [
4545
$name => [

0 commit comments

Comments
 (0)