diff --git a/docs/changelog/5.x.x.txt b/docs/changelog/5.x.x.txt index bb6c19b3e..e4d4feba0 100644 --- a/docs/changelog/5.x.x.txt +++ b/docs/changelog/5.x.x.txt @@ -5,6 +5,16 @@ - Fixed a possible counting problem when looking for an infinite loop in groups of groups. - Fixed a bug in the LDAP module that required the RDN to be a URL. + - bugfix [962196] addHTTP problem. + - bugfix [962224] WebGUI::Operation::Statistics + - bugfix [966470] WebGUI::User. Session not properly killed when deleting user. + - bugfix [966466] WebGUI::Session. System crash when user language missing. + - bugfix [ 981059 ] WebGUI vs perl 5.8.4 + - bugfix [ 975609 ] The form field for phone and email do not support maxlength + (Thanks to Junying Du). + - bugfix [ 938266 ] Fix: 5.5.4 Synopsis ignores hideFromNav (Thanks to + Nicklous Roberts.) + - bugfix [ 961056 ] pages erroneously owned by visitor 5.5.6 diff --git a/docs/changelog/6.x.x.txt b/docs/changelog/6.x.x.txt index 4c6c1b059..a72146ce4 100644 --- a/docs/changelog/6.x.x.txt +++ b/docs/changelog/6.x.x.txt @@ -68,6 +68,13 @@ database replication. - Templated the EditableToggle, a, and AdminToggle macros. Thanks to Colin Kuskie. + - bugfix [ 933881 ] Forms not compliant (solution). Thanks to Nicklous + Roberts. + - bugfix [ 934410 ] non-compliant HTML (solution). Thanks to Nicklous + Roberts. + - bugfix [ 963316 ] Field without title in Content Settings + + 6.0.3 - Fixed a recursive style change bug. diff --git a/lib/WebGUI/Auth.pm b/lib/WebGUI/Auth.pm index d68b1e245..cec95022e 100644 --- a/lib/WebGUI/Auth.pm +++ b/lib/WebGUI/Auth.pm @@ -214,7 +214,7 @@ sub createAccount { $vars->{'create.form.profile'} = WebGUI::Operation::Profile::getRequiredProfileFields(); $vars->{'create.form.submit'} = WebGUI::Form::submit({}); - $vars->{'create.form.footer'} = ""; + $vars->{'create.form.footer'} = WebGUI::Form::formFooter(); $vars->{'login.url'} = WebGUI::URL::page('op=auth&method=init'); $vars->{'login.label'} = WebGUI::International::get(58); @@ -377,7 +377,7 @@ sub displayAccount { $vars->{'account.form.karma.label'} = WebGUI::International::get(537); } $vars->{'account.form.submit'} = WebGUI::Form::submit({}); - $vars->{'account.form.footer'} = ""; + $vars->{'account.form.footer'} = WebGUI::Form::formFooter(); $vars->{'account.options'} = WebGUI::Operation::Shared::accountOptions(); return WebGUI::Template::process(1,$template, $vars); @@ -427,7 +427,7 @@ sub displayLogin { $vars->{'login.form.password'} = WebGUI::Form::password({"name"=>"identifier"}); $vars->{'login.form.password.label'} = WebGUI::International::get(51); $vars->{'login.form.submit'} = WebGUI::Form::submit({"value"=>WebGUI::International::get(52)}); - $vars->{'login.form.footer'} = ""; + $vars->{'login.form.footer'} = WebGUI::Form::formFooter(); $vars->{'anonymousRegistration.isAllowed'} = ($session{setting}{anonymousRegistration}); $vars->{'createAccount.url'} = WebGUI::URL::page('op=createAccount'); $vars->{'createAccount.label'} = WebGUI::International::get(67); diff --git a/lib/WebGUI/Auth/WebGUI.pm b/lib/WebGUI/Auth/WebGUI.pm index 4ca0465f7..149158a39 100644 --- a/lib/WebGUI/Auth/WebGUI.pm +++ b/lib/WebGUI/Auth/WebGUI.pm @@ -390,7 +390,7 @@ sub recoverPassword { $vars->{'recover.form.hidden'} .= WebGUI::Form::hidden({"name"=>"method","value"=>"recoverPasswordFinish"}); $vars->{'recover.form.submit'} = WebGUI::Form::submit({}); - $vars->{'recover.form.footer'} = ""; + $vars->{'recover.form.footer'} = WebGUI::Form::formFooter(); $vars->{'login.url'} = WebGUI::URL::page('op=auth&method=init'); $vars->{'login.label'} = WebGUI::International::get(58); @@ -457,7 +457,7 @@ sub resetExpiredPassword { $vars->{'expired.form.passwordConfirm'} = WebGUI::Form::password({"name"=>"identifierConfirm"}); $vars->{'expired.form.passwordConfirm.label'} = WebGUI::International::get(2,'AuthWebGUI'); $vars->{'expired.form.submit'} = WebGUI::Form::submit({}); - $vars->{'expired.form.footer'} = ""; + $vars->{'expired.form.footer'} = WebGUI::Form::formFooter(); return WebGUI::Template::process(1,'AuthWebGUI/Expired', $vars); } diff --git a/lib/WebGUI/Config.pm b/lib/WebGUI/Config.pm index 65e92740b..428334800 100644 --- a/lib/WebGUI/Config.pm +++ b/lib/WebGUI/Config.pm @@ -147,6 +147,8 @@ sub readConfig { } else { $data{defaultSitename} = $data{sitename}; } + $data{webguiRoot} = $webguiPath; + $data{configFile} = $filename; return \%data; } diff --git a/lib/WebGUI/Form.pm b/lib/WebGUI/Form.pm index 2172960eb..c1caf151f 100644 --- a/lib/WebGUI/Form.pm +++ b/lib/WebGUI/Form.pm @@ -46,6 +46,7 @@ Base forms package. Eliminates some of the normal code work that goes along with $html = WebGUI::Form::email({name=>"emailAddress"}); $html = WebGUI::Form::fieldType({name=>"fieldType"); $html = WebGUI::Form::file({name=>"image"}); + $html = WebGUI::Form::formFooter(); $html = WebGUI::Form::formHeader(); $html = WebGUI::Form::filterContent({value=>"javascript"}); $html = WebGUI::Form::float({name=>"distance"}); @@ -675,6 +676,19 @@ sub filterContent { }); } +#------------------------------------------------------------------- + +=head2 formFooter ( ) + +Returns a form footer. + +=cut + +sub formFooter { + return "\n\n"; +} + + #------------------------------------------------------------------- =head2 formHeader ( hashRef ) @@ -718,7 +732,7 @@ sub formHeader { } my $method = $_[0]->{method} || "POST"; my $enctype = $_[0]->{enctype} || "multipart/form-data"; - return '
{extras}.'>'.$hidden; + return '{extras}.'>
'.$hidden; } @@ -1164,7 +1178,7 @@ The number of characters wide this form element should be. There should be no re sub phone { WebGUI::Style::setScript($session{config}{extrasURL}.'/inputCheck.js',{ language=>'javascript' }); - my $maxLength = $_[0]->{maxLength} || 30; + my $maxLength = $_[0]->{maxlength} || 30; return text({ name=>$_[0]->{name}, maxlength=>$maxLength, @@ -1714,7 +1728,7 @@ The number of characters wide this form element should be. There should be no re sub zipcode { WebGUI::Style::setScript($session{config}{extrasURL}.'/inputCheck.js',{ language=>'javascript' }); - my $maxLength = $_[0]->{maxLength} || 10; + my $maxLength = $_[0]->{maxlength} || 10; return text({ name=>$_[0]->{name}, maxlength=>$maxLength, diff --git a/lib/WebGUI/Forum/UI.pm b/lib/WebGUI/Forum/UI.pm index 717eb1471..2a74e5471 100644 --- a/lib/WebGUI/Forum/UI.pm +++ b/lib/WebGUI/Forum/UI.pm @@ -1886,7 +1886,7 @@ sub www_post { name=>'subject', value=>$subject }); - $var->{'form.end'} = ''; + $var->{'form.end'} = WebGUI::Form::formFooter(); return WebGUI::Template::process($forum->get("postformTemplateId"),"Forum/PostForm", $var); } @@ -2083,7 +2083,7 @@ sub www_search { value=>[$numResults] }); $var{'form.search'} = WebGUI::Form::submit({value=>WebGUI::International::get(170)}); - $var{'form.end'} = ''; + $var{'form.end'} = WebGUI::Form::formFooter(); $var{'thread.list.url'} = formatForumURL($caller->{callback},$forum->get("forumId")); $var{'thread.list.label'} = WebGUI::International::get(1019); $var{doit} = $session{form}{doit}; diff --git a/lib/WebGUI/HTMLForm.pm b/lib/WebGUI/HTMLForm.pm index 8bfd0c520..896da4b12 100644 --- a/lib/WebGUI/HTMLForm.pm +++ b/lib/WebGUI/HTMLForm.pm @@ -1408,7 +1408,7 @@ sub new { }); $header .= "\n' unless ($noTable); $footer = "
\n" unless ($noTable); - $footer .= "\n\n"; + $footer .= WebGUI::Form::formFooter(); bless {_noTable => $noTable, _header => $header, _footer => $footer, _data => ''}, $self; } diff --git a/lib/WebGUI/International.pm b/lib/WebGUI/International.pm index 0dd3183a4..cb8b39b02 100644 --- a/lib/WebGUI/International.pm +++ b/lib/WebGUI/International.pm @@ -146,7 +146,7 @@ Returns a hash reference to the languages (languageId/lanugage) installed on thi sub getLanguages { my ($hashRef); my $dir = $session{config}{webguiRoot}.$session{os}{slash}."lib".$session{os}{slash}."WebGUI".$session{os}{slash}."i18n"; - opendir (DIR,$dir) or WebGUI::ErrorHandler::fatalError("Can't open I18N directory!"); + opendir (DIR,$dir) or WebGUI::ErrorHandler::fatalError("Can't open I18N directory! ".$dir); my @files = readdir(DIR); closedir(DIR); foreach my $file (@files) { diff --git a/lib/WebGUI/Macro.pm b/lib/WebGUI/Macro.pm index 133013266..1b41d87ec 100644 --- a/lib/WebGUI/Macro.pm +++ b/lib/WebGUI/Macro.pm @@ -45,7 +45,14 @@ These functions are available from this package: =cut -our $parenthesis; +our $parenthesis = qr /\( # Start with '(', + (?: # Followed by + (?>[^()]+) # Non-parenthesis + |(??{ $parenthesis }) # Or a balanced parenthesis block + )* # zero or more times + \)/x; # Ending with ')' + + our $nestedMacro = qr /(\^ # Start with carat ([^\^;()]+) # And one or more none-macro characters -tagged- ((?: # Followed by @@ -57,12 +64,6 @@ our $nestedMacro = qr /(\^ # Start with carat -$parenthesis = qr /\( # Start with '(', - (?: # Followed by - (?>[^()]+) # Non-parenthesis - |(??{ $parenthesis }) # Or a balanced parenthesis block - )* # zero or more times - \)/x; # Ending with ')' #------------------------------------------------------------------- diff --git a/lib/WebGUI/Macro/I_imageWithTags.pm b/lib/WebGUI/Macro/I_imageWithTags.pm index dc3c2c324..b0063a296 100644 --- a/lib/WebGUI/Macro/I_imageWithTags.pm +++ b/lib/WebGUI/Macro/I_imageWithTags.pm @@ -19,7 +19,12 @@ use WebGUI::Session; sub process { my @param = WebGUI::Macro::getParams($_[0]); if (my $collateral = WebGUI::Collateral->find($param[0])) { - return 'get("parameters").' />'; + my $tag = 'get("parameters"); + unless ($tag =~ /alt\=/i) { + $tag .= ' alt="'.$collateral->get("name").'"'; + } + $tag .= ' />'; + return $tag; } else { return ""; } diff --git a/lib/WebGUI/Macro/L_loginBox.pm b/lib/WebGUI/Macro/L_loginBox.pm index b3f3fd6e9..b2cba96b4 100644 --- a/lib/WebGUI/Macro/L_loginBox.pm +++ b/lib/WebGUI/Macro/L_loginBox.pm @@ -63,7 +63,7 @@ sub process { }); $var{'account.create.url'} = WebGUI::URL::page('op=createAccount'); $var{'account.create.label'} = WebGUI::International::get(407); - $var{'form.footer'} = ''; + $var{'form.footer'} = WebGUI::Form::formFooter(); return WebGUI::Template::process($templateId,"Macro/L_loginBox",\%var); } diff --git a/lib/WebGUI/Operation/Group.pm b/lib/WebGUI/Operation/Group.pm index 5d444ef28..cd2be5da0 100644 --- a/lib/WebGUI/Operation/Group.pm +++ b/lib/WebGUI/Operation/Group.pm @@ -532,7 +532,7 @@ sub www_manageUsersInGroup { $output .= ''.$row->{username}.''; $output .= ''.epochToHuman($row->{expireDate},"%z").''; } - $output .= ''; + $output .= ''.WebGUI::Form::formFooter(); $output .= '

'.WebGUI::International::get(976).'

'; $output .= WebGUI::Operation::User::getUserSearchForm("manageUsersInGroup",{gid=>$session{form}{gid}}); my ($userCount) = WebGUI::SQL->quickArray("select count(*) from users"); diff --git a/lib/WebGUI/Operation/Profile.pm b/lib/WebGUI/Operation/Profile.pm index c24a43096..546acbf81 100644 --- a/lib/WebGUI/Operation/Profile.pm +++ b/lib/WebGUI/Operation/Profile.pm @@ -136,7 +136,7 @@ sub www_editProfile { $vars->{'profile.message'} = $_[0] if($_[0]); $vars->{'profile.form.header'} = "\n\n".WebGUI::Form::formHeader({}); - $vars->{'profile.form.footer'} = ""; + $vars->{'profile.form.footer'} = WebGUI::Form::formFooter(); $vars->{'profile.form.hidden'} = WebGUI::Form::hidden({"name"=>"op","value"=>"editProfileSave"}); $vars->{'profile.form.hidden'} .= WebGUI::Form::hidden({"name"=>"uid","value"=>$session{user}{userId}}); diff --git a/lib/WebGUI/Operation/Settings.pm b/lib/WebGUI/Operation/Settings.pm index f724ae7d1..f51fb3500 100644 --- a/lib/WebGUI/Operation/Settings.pm +++ b/lib/WebGUI/Operation/Settings.pm @@ -65,7 +65,6 @@ sub www_editContentSettings { $f->hidden("op","saveSettings"); $f->select("defaultPage",$pages,WebGUI::International::get(527),[$session{setting}{defaultPage}]); $f->select("notFoundPage",$pages,WebGUI::International::get(141),[$session{setting}{notFoundPage}]); - $f->text("docTypeDec",WebGUI::International::get(398),$session{setting}{docTypeDec}); $f->text( -name=>"favicon", -label=>WebGUI::International::get(897), diff --git a/lib/WebGUI/Operation/User.pm b/lib/WebGUI/Operation/User.pm index 179ec2ce7..794a4f0ef 100644 --- a/lib/WebGUI/Operation/User.pm +++ b/lib/WebGUI/Operation/User.pm @@ -438,7 +438,7 @@ sub www_editUserGroup { $output .= ''.$row->{groupName}.''; $output .= ''.epochToHuman($row->{expireDate},"%z").''; } - $output .= ''; + $output .= ''.WebGUI::Form::formFooter(); $output .= '

'.WebGUI::International::get(605).'

'; $output .= WebGUI::Operation::Group::getGroupSearchForm("editUserGroup",{uid=>$session{form}{uid}}); my ($groupCount) = WebGUI::SQL->quickArray("select count(*) from users"); diff --git a/lib/WebGUI/TabForm.pm b/lib/WebGUI/TabForm.pm index 5b817ef79..fc3545330 100644 --- a/lib/WebGUI/TabForm.pm +++ b/lib/WebGUI/TabForm.pm @@ -201,7 +201,7 @@ sub print { } $output .= '
'.$tabs.$_[0]->{_submit}.'
'; $output .= $form; - $output .= ''; + $output .= WebGUI::Form::formFooter(); $output .= ''; return $output; } diff --git a/lib/WebGUI/Wobject/DataForm.pm b/lib/WebGUI/Wobject/DataForm.pm index f34bb49dd..8d058243f 100644 --- a/lib/WebGUI/Wobject/DataForm.pm +++ b/lib/WebGUI/Wobject/DataForm.pm @@ -359,7 +359,7 @@ sub getRecordTemplateVars { $var->{tab_loop} = \@tabs; $var->{"form.send"} = WebGUI::Form::submit({value=>WebGUI::International::get(73, $self->get("namespace"))}); $var->{"form.save"} = WebGUI::Form::submit(); - $var->{"form.end"} = ""; + $var->{"form.end"} = WebGUI::Form::formFooter(); return $var; } diff --git a/lib/WebGUI/Wobject/Poll.pm b/lib/WebGUI/Wobject/Poll.pm index e79a37e6e..db75d4faf 100644 --- a/lib/WebGUI/Wobject/Poll.pm +++ b/lib/WebGUI/Wobject/Poll.pm @@ -253,7 +253,7 @@ sub www_view { $var{"form.start"} .= WebGUI::Form::hidden({name=>'wid',value=>$_[0]->get("wobjectId")}); $var{"form.start"} .= WebGUI::Form::hidden({name=>'func',value=>'vote'}); $var{"form.submit"} = WebGUI::Form::submit({value=>WebGUI::International::get(11,$_[0]->get("namespace"))}); - $var{"form.end"} = ""; + $var{"form.end"} = WebGUI::Form::formFooter(); $totalResponses = 1 if ($totalResponses < 1); for (my $i=1; $i<=20; $i++) { if ($_[0]->get('a'.$i) =~ /\C/) { diff --git a/lib/WebGUI/Wobject/Survey.pm b/lib/WebGUI/Wobject/Survey.pm index b0d750958..9304db2ed 100644 --- a/lib/WebGUI/Wobject/Survey.pm +++ b/lib/WebGUI/Wobject/Survey.pm @@ -917,7 +917,7 @@ sub www_view { name=>'func', value=>'respond' }); - $var->{'form.footer'} = ''; + $var->{'form.footer'} = WebGUI::Form::formFooter(); $var->{'form.submit'} = WebGUI::Form::submit({ value=>WebGUI::International::get(50,$self->get("namespace")) }); diff --git a/lib/WebGUI/Wobject/USS.pm b/lib/WebGUI/Wobject/USS.pm index 207abb2cc..698a6bd74 100644 --- a/lib/WebGUI/Wobject/USS.pm +++ b/lib/WebGUI/Wobject/USS.pm @@ -564,7 +564,7 @@ sub www_editSubmission { value=>[$submission->{contentType}] }); $var{'form.submit'} = WebGUI::Form::submit(); - $var{'form.footer'} = ''; + $var{'form.footer'} = WebGUI::Form::formFooter(); return $_[0]->processTemplate($_[0]->get("submissionFormTemplateId"),\%var,"USS/SubmissionForm"); }