From 7982d1f82b0a7f1efd30edeeacbf306ad161984b Mon Sep 17 00:00:00 2001 From: Kaleb Murphy Date: Mon, 21 Jul 2008 20:17:17 +0000 Subject: [PATCH] Web::Form::Asset can now accept assets with '|" in their names. --- docs/changelog/7.x.x.txt | 1 + lib/WebGUI/Form/Asset.pm | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index ac7b8b715..8232c202b 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -19,6 +19,7 @@ - fixed: more i18n (Shop tags) - fixed: i18nagain - fixed: Cash available as a payment option to everyone + - fixed: Web::Form::Asset can now accept assets with '|" in their names. 7.5.17 - fixed: Payment Methods Hover Help Incomplete diff --git a/lib/WebGUI/Form/Asset.pm b/lib/WebGUI/Form/Asset.pm index caa90005b..3d9409392 100644 --- a/lib/WebGUI/Form/Asset.pm +++ b/lib/WebGUI/Form/Asset.pm @@ -16,6 +16,7 @@ package WebGUI::Form::Asset; use strict; use base 'WebGUI::Form::Control'; +use HTML::Entities; use WebGUI::Asset; use WebGUI::Form::Button; use WebGUI::Form::Hidden; @@ -228,9 +229,11 @@ sub www_assetTree { foreach my $child (@{$children}) { next unless $child->canView; if ($limit eq "" || $child->get("className") =~ /^$limit/) { + my $tempChild = $child->get("title"); + $tempChild =~ s/(\'|\")/\\$1/g; $output .= 'getId.'\';window.opener.document.getElementById(\''. - $session->form->process("formId").'_display\').value=\''.$child->get("title").'\';window.close();">['.$i18n->get("select").'] '; + $session->form->process("formId").'_display\').value=\''.encode_entities($tempChild).'\';window.close();">['.$i18n->get("select").'] '; } else { $output .= '['.$i18n->get("select").'] '; }