diff --git a/docs/changelog/5.x.x.txt b/docs/changelog/5.x.x.txt index bc6b0755e..cf8c91044 100644 --- a/docs/changelog/5.x.x.txt +++ b/docs/changelog/5.x.x.txt @@ -1,3 +1,22 @@ +5.5.6 + - bugfix [ 895067 ] Forum ID Missing In USS + - bugfix [ 909688 ] USS forum post edit function not work + - bugfix [ 910514 ] Article Discussion - Not reporting correctly + - Bugfix [ 917535 ] 5.5.5 HTMLEdit - Insert Image Not Functional + - bugfix [ 912404 ] Visitors can turn admin on + - bugfix [ 917913, 915019, 913999, 912765, 912206 ] OwnerId was not set correctly + when saving page. + - Bugfix [ 884375 ] Fix for multiple forum posts applied also to + www_viewForum to handle postings that start a new thread. + - Bugfix [ 909579 ] possible package problem 5.5.4 + - Bugfix [ 918136 ] upgrade to 5.5.5 sql inserts wrong version number + - Bugfix [ 917338 ] Typo in 5.5.5 Email Data Form + - Bugfix [ 932243 ] Security bug: Env Host can be spoofed + - Bugfix [ 913525 ] Beg. / End Dates of WObjects + - Bugfix [ 927530 ] bugfix FormProcessor email checking change + + + 5.5.5 - Fixed a bug in AdminBar's clipboard code where a standard hash was used instead of a CPHash for database access. (Thanks to Steve Simms.) diff --git a/docs/gotcha.txt b/docs/gotcha.txt index bfd8b5aad..9c81c47b7 100644 --- a/docs/gotcha.txt +++ b/docs/gotcha.txt @@ -8,6 +8,12 @@ versions. Be sure to heed the warnings contained herein as they will save you many hours of grief. +6.0.2 +-------------------------------------------------------------------- + * You need to add all of your site aliases to the sitename variable + in your WebGUI config file. + + 6.0.1 -------------------------------------------------------------------- * Apache 2.0 is now the recommended web server for WebGUI. As such diff --git a/docs/upgrades/upgrade_5.5.4-5.5.5.sql b/docs/upgrades/upgrade_5.5.4-5.5.5.sql index 47fd04571..240da11a6 100644 --- a/docs/upgrades/upgrade_5.5.4-5.5.5.sql +++ b/docs/upgrades/upgrade_5.5.4-5.5.5.sql @@ -1,4 +1,4 @@ -insert into webguiVersion values ('5.5.4','upgrade',unix_timestamp()); +insert into webguiVersion values ('5.5.5','upgrade',unix_timestamp()); delete from international where internationalId=416 and namespace='WebGUI'; diff --git a/etc/WebGUI.conf.original b/etc/WebGUI.conf.original index 953cca06f..86bd6de62 100644 --- a/etc/WebGUI.conf.original +++ b/etc/WebGUI.conf.original @@ -1,6 +1,6 @@ -sitename = www.mycompany.com +sitename = www.example.com, example.com -dsn = DBI:mysql:WebGUI +dsn = DBI:mysql:www_example_com dbuser = webgui dbpass = password diff --git a/lib/WebGUI/DateTime.pm b/lib/WebGUI/DateTime.pm index 2af64a11a..93baa6a34 100644 --- a/lib/WebGUI/DateTime.pm +++ b/lib/WebGUI/DateTime.pm @@ -262,7 +262,7 @@ sub epochToHuman { my ($offset, $temp, $hour12, $value, $output); $offset = $session{user}{timeOffset} || 0; $offset = $offset*3600; - $temp = int($_[0]) || time(); + $temp = int($_[0]) || WebGUI::DateTime::time(); $temp = $temp+$offset; my ($year,$month,$day,$hour,$min,$sec) = epochToArray($temp); $output = $_[1] || "%z %Z"; @@ -785,7 +785,7 @@ A string in the format of YYYY-MM-DD or YYYY-MM-DD HH:MM:SS. =cut sub setToEpoch { - my @now = epochToArray(time()); + my @now = epochToArray(WebGUI::DateTime::time()); my ($date,$time) = split(/ /,$_[0]); my ($year, $month, $day) = split(/\-/,$date); my ($hour, $minute, $second) = split(/\:/,$time); diff --git a/lib/WebGUI/FormProcessor.pm b/lib/WebGUI/FormProcessor.pm index a573817de..cf5e1df19 100644 --- a/lib/WebGUI/FormProcessor.pm +++ b/lib/WebGUI/FormProcessor.pm @@ -67,6 +67,10 @@ These functions are available from this package: =cut +sub _checkEmailAddy { + return ($_[0] =~ /^([A-Z0-9]+[._-]?){1,}([A-Z0-9]+[_-]?)+\@(([A-Z0-9]+[._-]?){1,}[A-Z0-9]+\.){1,}[A-Z]{2,4}$/i); +} + #------------------------------------------------------------------- =head2 checkbox ( name ) @@ -211,7 +215,7 @@ The name of the form variable to retrieve. =cut sub email { - if ($session{form}{$_[0]} =~ /^([A-Z0-9]+[._-]?){1,}[A-Z0-9]+\@(([A-Z0-9]+[._-]?){1,}[A-Z0-9]+\.){1,}[A-Z]{2,4}$/i) { + if (_checkEmailAddy($session{form}{$_[0]})) { return $session{form}{$_[0]}; } return undef; @@ -671,7 +675,7 @@ The name of the form variable to retrieve. sub url { if ($session{form}{$_[0]} =~ /mailto:/) { return $session{form}{$_[0]}; - } elsif ($session{form}{$_[0]} =~ /^([A-Z0-9]+[._]?){1,}[A-Z0-9]+\@(([A-Z0-9]+[-]?){1,}[A-Z0-9]+\.){1,}[A-Z]{2,4}$/i) { + } elsif (_checkEmailAddy($session{form}{$_[0]})) { return "mailto:".$session{form}{$_[0]}; } elsif ($session{form}{$_[0]} =~ /:\/\//) { return $session{form}{$_[0]}; diff --git a/lib/WebGUI/Operation/Page.pm b/lib/WebGUI/Operation/Page.pm index 5609c5c8a..9590896ce 100644 --- a/lib/WebGUI/Operation/Page.pm +++ b/lib/WebGUI/Operation/Page.pm @@ -331,6 +331,9 @@ sub www_editPage { $page{title} = $page{menuTitle} = $page{urlizedTitle} = $page{synopsis} = ''; $page{parentId} = $session{form}{npp}; $page{ownerId} = $session{user}{userId}; + $page{hideFromNavigation} = 0; + $page{newWindow} = 0; + $page{redirectURL} = ""; } else { %page = %{$session{page}}; ($childCount) = WebGUI::SQL->quickArray("select count(*) from page where parentId=$page{pageId}"); diff --git a/lib/WebGUI/Session.pm b/lib/WebGUI/Session.pm index ec360f27a..e7c50a7c4 100644 --- a/lib/WebGUI/Session.pm +++ b/lib/WebGUI/Session.pm @@ -407,6 +407,11 @@ sub open { $session{config}{extrasURL} = $session{config}{extrasURL} || $session{config}{extras} || "/extras"; $session{config}{extras} = $session{config}{extras} || $session{config}{extrasURL}; # for backward compatibility $session{config}{extrasPath} = $session{config}{extrasPath} || "/data/WebGUI/www/extras"; + if (ref $session{config}{sitename} eq "ARRAY") { + $session{config}{defaultSitename} = $session{config}{sitename}[0]; + } else { + $session{config}{defaultSitename} = $session{config}{sitename}; + } ###---------------------------- ### default database handler object $session{dbh} = DBI->connect($session{config}{dsn},$session{config}{dbuser},$session{config}{dbpass},{ RaiseError=>0,AutoCommit=>1 }); diff --git a/lib/WebGUI/URL.pm b/lib/WebGUI/URL.pm index 0b6ba8df8..ea45eff13 100644 --- a/lib/WebGUI/URL.pm +++ b/lib/WebGUI/URL.pm @@ -47,22 +47,28 @@ These subroutines are available from this package: =cut - #------------------------------------------------------------------- sub _getSiteURL { - my $site; - if ($session{setting}{hostToUse} eq "sitename") { - $site = $session{config}{sitename} || $session{env}{HTTP_HOST}; - } else { - $site = $session{env}{HTTP_HOST} || $session{config}{sitename}; - } - my $proto = "http://"; - if ($session{env}{SERVER_PORT} == 443) { - $proto = "https://"; - } - return $proto.$site; + my $site; + my @sitenames; + if (ref $session{config}{sitename} eq "ARRAY") { + @sitenames = @{$session{config}{sitename}}; + } else { + push(@sitenames,$session{config}{sitename}); + } + if ($session{setting}{hostToUse} eq "sitename" || !isIn($session{env}{HTTP_HOST},@sitenames)) { + $site = $session{config}{defaultSitename}; + } else { + $site = $session{env}{HTTP_HOST} || $session{config}{defaultSitename}; + } + my $proto = "http://"; + if ($session{env}{SERVER_PORT} == 443) { + $proto = "https://"; + } + return $proto.$site; } + #------------------------------------------------------------------- =head2 append ( url, pairs ) diff --git a/lib/WebGUI/Wobject/DataForm.pm b/lib/WebGUI/Wobject/DataForm.pm index 8e9eb72a3..1f6a8cfbe 100644 --- a/lib/WebGUI/Wobject/DataForm.pm +++ b/lib/WebGUI/Wobject/DataForm.pm @@ -295,7 +295,7 @@ sub getRecordTemplateVars { my $hidden = (($data{status} eq "hidden" && !$session{var}{adminOn}) || ($data{isMailField} && !$self->get("mailData"))); my $value = $data{value}; $value = WebGUI::DateTime::epochToHuman($value,"%z") if ($data{type} eq "date"); - $value = WebGUI::DateTime::epochToHuman($value) if ($data{type} eq "dateTime"); + $value = WebGUI::DateTime::epochToHuman($value,"%z %Z") if ($data{type} eq "dateTime"); push(@fields,{ "tab.field.form" => _createField(\%data), "tab.field.name" => $data{name},