diff options
author | Bharat Mediratta <bharat@menalto.com> | 2009-09-11 11:04:35 -0700 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2009-09-11 11:04:35 -0700 |
commit | 7ec490b6009965920fea35e971b29f11df6e6bff (patch) | |
tree | 83fabdcc912b6f546c76bfe87c790898d7c1c73e /modules/gallery/tests | |
parent | 3ac3d1e520f95cc859d990000561dbb727411e0c (diff) |
rawurlencode() path components in relative_path_cache and
relative_url_cache so that they're safe for browser use.
Diffstat (limited to 'modules/gallery/tests')
-rw-r--r-- | modules/gallery/tests/Item_Model_Test.php | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/modules/gallery/tests/Item_Model_Test.php b/modules/gallery/tests/Item_Model_Test.php index 585e247c..84210e4c 100644 --- a/modules/gallery/tests/Item_Model_Test.php +++ b/modules/gallery/tests/Item_Model_Test.php @@ -150,4 +150,14 @@ class Item_Model_Test extends Unit_Test_Case { $this->assert_same("ORIGINAL_VALUE", $item->original()->title); $this->assert_same("NEW_VALUE", $item->title); } + + public function urls_are_rawurlencoded_test() { + $item = self::_create_random_item(); + $item->slug = "foo bar"; + $item->name = "foo bar.jpg"; + $item->save(); + + $this->assert_equal("foo%20bar", $item->relative_url()); + $this->assert_equal("foo%20bar.jpg", $item->relative_path()); + } } |