A couple of fixes to the one pass macro system.
This commit is contained in:
parent
589b975a3d
commit
ac556717db
2 changed files with 30 additions and 6 deletions
|
|
@ -68,6 +68,13 @@ All of the functions in this package accept the input of a hash reference contai
|
|||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub _fixMacros {
|
||||
my $value = shift;
|
||||
$value =~ s/\^/\&\#94\;/g;
|
||||
return $value;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub _fixQuotes {
|
||||
my $value = shift;
|
||||
|
|
@ -82,6 +89,14 @@ sub _fixSpecialCharacters {
|
|||
return $value;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub _fixTags {
|
||||
my $value = shift;
|
||||
$value =~ s/\</\<\;/g;
|
||||
$value =~ s/\>/\>\;/g;
|
||||
return $value;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 checkbox ( hashRef )
|
||||
|
|
@ -1244,8 +1259,9 @@ The number of characters wide this form element should be. There should be no re
|
|||
|
||||
sub text {
|
||||
my ($size, $maxLength, $value);
|
||||
$value = _fixSpecialCharacters($value);
|
||||
$value = _fixQuotes($_[0]->{value});
|
||||
$value = _fixSpecialCharacters($_[0]->{value});
|
||||
$value = _fixQuotes($value);
|
||||
$value = _fixMacros($value);
|
||||
$maxLength = $_[0]->{maxlength} || 255;
|
||||
$size = $_[0]->{size} || $session{setting}{textBoxSize} || 30;
|
||||
return '<input type="text" name="'.$_[0]->{name}.'" value="'.$value.'" size="'.
|
||||
|
|
@ -1296,8 +1312,8 @@ sub textarea {
|
|||
$rows = $_[0]->{rows} || $session{setting}{textAreaRows} || 5;
|
||||
$columns = $_[0]->{columns} || $session{setting}{textAreaCols} || 50;
|
||||
$value = _fixSpecialCharacters($_[0]->{value});
|
||||
$value =~ s/\</\<\;/g;
|
||||
$value =~ s/\>/\>\;/g;
|
||||
$value = _fixTags($value);
|
||||
$value = _fixMacros($value);
|
||||
return '<textarea name="'.$_[0]->{name}.'" cols="'.$columns.'" rows="'.$rows.'" wrap="'.
|
||||
$wrap.'" '.$_[0]->{extras}.'>'.$value.'</textarea>';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1118,12 +1118,20 @@ sub www_edit {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 www_editSave ( )
|
||||
=head2 www_editSave ( hashRef )
|
||||
|
||||
Saves the default properties of any/all wobjects.
|
||||
|
||||
NOTE: This method should be extended by all subclasses.
|
||||
|
||||
=over
|
||||
|
||||
=item hashRef
|
||||
|
||||
A hash reference of extra properties to set.
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
|
||||
sub www_editSave {
|
||||
|
|
@ -1151,7 +1159,7 @@ sub www_editSave {
|
|||
editTimeout=>$session{form}{editTimeout},
|
||||
moderationType=>$session{form}{moderationType},
|
||||
filterPost=>$session{form}{filterPost},
|
||||
addEditStampToPosts=>$session{form}{addEditStampToPosts}
|
||||
addEditStampToPosts=>$session{form}{addEditStampToPosts},
|
||||
%{$_[1]}
|
||||
});
|
||||
return "";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue