From fb11021ed7eadf7443755e936cbad34fbfec7d4c Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Tue, 3 May 2011 19:10:12 +0200 Subject: do not add bookmarks with an invalid URL --- tests/BookmarkTest.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/BookmarkTest.php b/tests/BookmarkTest.php index e7ce488..7533f3a 100644 --- a/tests/BookmarkTest.php +++ b/tests/BookmarkTest.php @@ -65,7 +65,16 @@ class BookmarkTest extends TestBase $this->assertEquals('myShortName', $bm['bShort']); } - public function testHardCharactersInBookmarks() + public function testAddBookmarkInvalidUrl() + { + $retval = $this->bs->addBookmark( + 'javascript:alert(123)', 'title', 'desc', 'priv', + 0, array() + ); + $this->assertFalse($retval, 'Bookmark with invalid URL was accepted'); + } + + public function testAddBookmarkWithSpecialCharacters() { $bs = $this->bs; $title = "title&é\"'(-è_çà)="; -- cgit v1.2.3