summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoruckelman <uckelman@nomic.net>2010-04-25 20:37:00 +0000
committeruckelman <uckelman@nomic.net>2010-04-25 20:37:00 +0000
commit220fc30dcd11beee18fb23d60456c901ab6b392d (patch)
treeb75ec2cdd25427738df579b39bbc07b3d2ff3b17
parent4148fbc381045066a724feb2f592592257759ba5 (diff)
Added test.
git-svn-id: https://vassalengine.svn.sourceforge.net/svnroot/vassalengine/site-src/trunk@6750 67b53d14-2c14-4ace-a08f-0dab2b34000c
-rw-r--r--src/BBCodeParser.php2
-rw-r--r--test/BBCodeParserTest.php2
2 files changed, 3 insertions, 1 deletions
diff --git a/src/BBCodeParser.php b/src/BBCodeParser.php
index eacff6a..1083f7e 100644
--- a/src/BBCodeParser.php
+++ b/src/BBCodeParser.php
@@ -9,7 +9,7 @@ class BBCodeParser {
function parse($in, $uid) {
# decode HTML entities before parsing
- $in = html_entity_decode($in);
+ $in = html_entity_decode($in, 'UTF-8');
$text_stack = array();
$arg_stack = array();
diff --git a/test/BBCodeParserTest.php b/test/BBCodeParserTest.php
index ef9ecc7..2391fae 100644
--- a/test/BBCodeParserTest.php
+++ b/test/BBCodeParserTest.php
@@ -19,6 +19,8 @@ class BBCodeParserTest extends PHPUnit_Framework_TestCase {
array('', '3i2cqt66', '', null),
array('[b:3i2cqt66]This is a[/b:3i2cqt66] test of [i:3i2cqt66]the BBCode[/i:3i2cqt66] parser. Will [u:3i2cqt66][i:3i2cqt66]it[/i:3i2cqt66][/u:3i2cqt66] parse? Also, throw in some difficult characters: 1 &lt; 2 &lt; 4 &gt; 3.', '3i2cqt66', "__This is a__ test of _the BBCode_ parser. Will __it__ parse? Also,\nthrow in some difficult characters: 1 < 2 < 4 > 3.", null),
array("[quote:2nnqpmcp]Here's some quoty stuff.[quote:2nnqpmcp]Followed by an even deeper quote.[/quote:2nnqpmcp]Followed by more stuff.[/quote:2nnqpmcp]", '2nnqpmcp', "\n> Here's some quoty stuff.\n> > Followed by an even deeper quote.\n> Followed by more stuff.\n", null),
+ array('This is a rather long line. This is a rather long line. This is a rather long line. This is a rather long line. This is a rather long line. This is a rather long line.[quote:2nnqpmcp]This is a rather long line. This is a rather long line. This is a rather long line. This is a rather long line. This is a rather long line. This is a rather long line.[quote:2nnqpmcp]This is a rather long line. This is a rather long line. This is a rather long line. This is a rather long line. This is a rather long line. This is a rather long line.[/quote:2nnqpmcp][/quote:2nnqpmcp]', '2nnqpmcp', "This is a rather long line. This is a rather long line. This is a\nrather long line. This is a rather long line. This is a rather long\nline. This is a rather long line.\n> This is a rather long line. This is a rather long line. This is a\n> rather long line. This is a rather long line. This is a rather long\n> line. This is a rather long line.\n> > This is a rather long line. This is a rather long line. This is a\n> > rather long line. This is a rather long line. This is a rather long\n> > line. This is a rather long line.\n", null),
+
# array("Foo\n[list:11cx3qbi]\n[*:11cx3qbi] first[/*:11cx3qbi]\n[*:11cx3qbi] second[/*:11cx3qbi][/list:o:11cx3qbi]\nBar", '11cx3qbi', "Foo\n\n * first\n * second\n\nBar", null)
);
}