From 944165ec576727b2a922965dd20b9567f4705333 Mon Sep 17 00:00:00 2001 From: JT Smith Date: Thu, 11 Jul 2002 00:27:22 +0000 Subject: [PATCH] Fixed a problem where image names specified with quotes or half quotes would crash the macro. --- lib/WebGUI/Macro/I_imageWithTags.pm | 2 +- lib/WebGUI/Macro/i_imageNoTags.pm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/WebGUI/Macro/I_imageWithTags.pm b/lib/WebGUI/Macro/I_imageWithTags.pm index eda577138..b7dda6c69 100644 --- a/lib/WebGUI/Macro/I_imageWithTags.pm +++ b/lib/WebGUI/Macro/I_imageWithTags.pm @@ -22,7 +22,7 @@ sub _replacement { my (@param, $temp, %data, $image); tie %data, 'Tie::CPHash'; @param = WebGUI::Macro::getParams($_[0]); - %data = WebGUI::SQL->quickHash("select * from images where name='$param[0]'"); + %data = WebGUI::SQL->quickHash("select * from images where name=".quote($param[0])); $image = WebGUI::Attachment->new($data{filename},"images",$data{imageId}); $temp = ''; return $temp; diff --git a/lib/WebGUI/Macro/i_imageNoTags.pm b/lib/WebGUI/Macro/i_imageNoTags.pm index 4e819d3e2..447f410d1 100644 --- a/lib/WebGUI/Macro/i_imageNoTags.pm +++ b/lib/WebGUI/Macro/i_imageNoTags.pm @@ -22,7 +22,7 @@ sub _replacement { my (@param, $image, %data); tie %data, 'Tie::CPHash'; @param = WebGUI::Macro::getParams($_[0]); - %data = WebGUI::SQL->quickHash("select * from images where name='$param[0]'"); + %data = WebGUI::SQL->quickHash("select * from images where name=".quote($param[0])); $image = WebGUI::Attachment->new($data{filename},"images",$data{imageId}); return $image->getURL; }