Fixed a problem where image names specified with quotes or half quotes would crash the macro.
This commit is contained in:
parent
cbcb32922d
commit
944165ec57
2 changed files with 2 additions and 2 deletions
|
|
@ -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 = '<img src="'.$image->getURL.'" '.$data{parameters}.'>';
|
||||
return $temp;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue