From b8734928500d9fb650f89286b325a27defa0b23f Mon Sep 17 00:00:00 2001 From: "Michael J. Rubinsky" Date: Thu, 10 Dec 2009 13:25:54 -0500 Subject: [PATCH] Horde_Url cast to string --- ansel/lib/Block/recently_added_geodata.php | 4 ++-- ansel/lib/Storage.php | 6 +++--- ansel/lib/View/Base.php | 6 +++--- ansel/lib/Widget/Geotag.php | 8 ++++---- ansel/lib/Widget/OtherGalleries.php | 2 +- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/ansel/lib/Block/recently_added_geodata.php b/ansel/lib/Block/recently_added_geodata.php index 2a29247a8..742569f8d 100644 --- a/ansel/lib/Block/recently_added_geodata.php +++ b/ansel/lib/Block/recently_added_geodata.php @@ -121,8 +121,8 @@ class Horde_Block_ansel_recently_added_geodata extends Horde_Block { 'gallery' => $gallery->id, 'image' => $id, 'gallery_view' => $style['gallery_view']), true); - $images[$key]['icon'] = Ansel::getImageUrl($images[$key]['image_id'], 'mini', true); - $images[$key]['link'] = $url; + $images[$key]['icon'] = (string)Ansel::getImageUrl($images[$key]['image_id'], 'mini', true); + $images[$key]['link'] = (string)$url; } $json = Horde_Serialize::serialize(array_values($images), Horde_Serialize::JSON); diff --git a/ansel/lib/Storage.php b/ansel/lib/Storage.php index 274331305..81b1ae276 100644 --- a/ansel/lib/Storage.php +++ b/ansel/lib/Storage.php @@ -866,21 +866,21 @@ class Ansel_Storage } if ($galleries[$gallery_id]['perm']) { - $data = array(Ansel::getImageUrl($image->id, $image_view, $full, $style), + $data = array((string)Ansel::getImageUrl($image->id, $image_view, $full, $style), htmlspecialchars($image->filename, ENT_COMPAT, Horde_Nls::getCharset()), Horde_Text_Filter::filter($image->caption, 'text2html', array('parselevel' => Horde_Text_Filter_Text2html::MICRO_LINKURL)), $image->id, 0); if ($view_links) { - $data[] = Ansel::getUrlFor('view', + $data[] = (string)Ansel::getUrlFor('view', array('gallery' => $image->gallery, 'image' => $image->id, 'view' => 'Image', 'slug' => $galleries[$gallery_id]['gallery']->get('slug')), $full); - $data[] = Ansel::getUrlFor('view', + $data[] = (string)Ansel::getUrlFor('view', array('gallery' => $image->gallery, 'slug' => $galleries[$gallery_id]['gallery']->get('slug'), 'view' => 'Gallery'), diff --git a/ansel/lib/View/Base.php b/ansel/lib/View/Base.php index 5423a7fa5..4420c003c 100644 --- a/ansel/lib/View/Base.php +++ b/ansel/lib/View/Base.php @@ -202,20 +202,20 @@ abstract class Ansel_View_Base $curimage = 0; } - $data = array(Ansel::getImageUrl($image->id, $params['image_view'], $params['full'], $style['name']), + $data = array((string)Ansel::getImageUrl($image->id, $params['image_view'], $params['full'], $style['name']), htmlspecialchars($image->filename, ENT_COMPAT, Horde_Nls::getCharset()), Horde_Text_Filter::filter($image->caption, 'text2html', array('parselevel' => Horde_Text_Filter_Text2html::MICRO_LINKURL)), $image->id, $curpage); if ($params['view_links']) { - $data[] = Ansel::getUrlFor('view', + $data[] = (string)Ansel::getUrlFor('view', array('gallery' => $this->gallery->id, 'slug' => $this->gallery->get('slug'), 'image' => $image->id, 'view' => 'Image', 'page' => $curpage), true); - $data[] = Ansel::getUrlFor('view', + $data[] = (string)Ansel::getUrlFor('view', array('gallery' => $image->gallery, 'slug' => $this->gallery->get('slug'), 'view' => 'Gallery'), diff --git a/ansel/lib/Widget/Geotag.php b/ansel/lib/Widget/Geotag.php index c7eb41398..b8878bec5 100644 --- a/ansel/lib/Widget/Geotag.php +++ b/ansel/lib/Widget/Geotag.php @@ -69,9 +69,9 @@ class Ansel_Widget_Geotag extends Ansel_Widget_Base // Add extra information to the JSON data to be sent: foreach ($geodata as $id => $data) { - $geodata[$id]['icon'] = Ansel::getImageUrl($geodata[$id]['image_id'], 'mini', true); + $geodata[$id]['icon'] = (string)Ansel::getImageUrl($geodata[$id]['image_id'], 'mini', true); $geodata[$id]['markerOnly'] = ($viewType == 'Image'); - $geodata[$id]['link'] = Ansel::getUrlFor('view', array('view' => 'Image', + $geodata[$id]['link'] = (string)Ansel::getUrlFor('view', array('view' => 'Image', 'gallery' => $this->_view->gallery->id, 'image' => $geodata[$id]['image_id']), true); } @@ -82,8 +82,8 @@ class Ansel_Widget_Geotag extends Ansel_Widget_Base $others = $this->_getGalleryImagesWithGeodata(); foreach ($others as $id => $data) { if ($id != $image_id) { - $others[$id]['icon'] = Ansel::getImageUrl($others[$id]['image_id'], 'mini', true); - $others[$id]['link'] = Ansel::getUrlFor('view', array('view' => 'Image', + $others[$id]['icon'] = (string)Ansel::getImageUrl($others[$id]['image_id'], 'mini', true); + $others[$id]['link'] = (string)Ansel::getUrlFor('view', array('view' => 'Image', 'gallery' => $this->_view->gallery->id, 'image' => $others[$id]['image_id']), true); } else { diff --git a/ansel/lib/Widget/OtherGalleries.php b/ansel/lib/Widget/OtherGalleries.php index 68c13870d..5013c1d12 100644 --- a/ansel/lib/Widget/OtherGalleries.php +++ b/ansel/lib/Widget/OtherGalleries.php @@ -91,7 +91,7 @@ class Ansel_Widget_OtherGalleries extends Ansel_Widget_Base $parent = array_pop($parents); } - $img = Ansel::getImageUrl($gal->getDefaultImage('ansel_default'), 'mini', true); + $img = (string)Ansel::getImageUrl($gal->getDefaultImage('ansel_default'), 'mini', true); $link = Ansel::getUrlFor('view', array('gallery' => $gal->id, 'slug' => $gal->get('slug'), 'view' => 'Gallery'), -- 2.11.0