diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 6434fe87c..4b70dac74 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -8,6 +8,7 @@ - As a result of the above, we no longer need extjs, and it has been removed. - added script to remove unneeded .wgaccess files instead of having it run during upgrade + - fixed: wiki pages link to deleted pages (Arjan Widlak, United Knowledge) 7.5.3 - prevent HTML and Macro injection in usernames diff --git a/lib/WebGUI/Asset/Wobject/WikiMaster.pm b/lib/WebGUI/Asset/Wobject/WikiMaster.pm index a1f646b44..a9ef5680e 100644 --- a/lib/WebGUI/Asset/Wobject/WikiMaster.pm +++ b/lib/WebGUI/Asset/Wobject/WikiMaster.pm @@ -42,7 +42,7 @@ sub appendRecentChanges { my $limit = shift || $self->get("recentChangesCount") || 50; my $revisions = $self->session->db->read("select asset.assetId, assetData.revisionDate, asset.className from asset left join assetData using (assetId) where asset.parentId=? and asset.className - like ? order by assetData.revisionDate desc limit ?", [$self->getId, + like ? and status='approved' order by assetData.revisionDate desc limit ?", [$self->getId, "WebGUI::Asset::WikiPage%", $limit]); while (my ($id, $version, $class) = $revisions->array) { my $asset = WebGUI::Asset->new($self->session, $id, $class, $version); @@ -98,7 +98,7 @@ sub autolinkHtml { my %opts = ref $_[-1] eq 'HASH' ? %{pop @_} : (); my $skipTitles = $opts{skipTitles} || []; # TODO: ignore caching for now, but maybe do it later. - my %mapping = $self->session->db->buildHash("SELECT LOWER(d.title), d.url FROM asset AS i INNER JOIN assetData AS d ON i.assetId = d.assetId WHERE i.parentId = ? and className='WebGUI::Asset::WikiPage'", [$self->getId]); + my %mapping = $self->session->db->buildHash("SELECT LOWER(d.title), d.url FROM asset AS i INNER JOIN assetData AS d ON i.assetId = d.assetId WHERE i.parentId = ? and className='WebGUI::Asset::WikiPage' and i.state='published' and d.status='approved'", [$self->getId]); foreach my $key (keys %mapping) { if (grep {lc $_ eq $key} @$skipTitles) { delete $mapping{$key};