Loading...
 
Skip to main content

Including multiple excerpts from the same page

Status
Open
Subject
Including multiple excerpts from the same page
Version
2.x
3.x
4.x
Feature
Wiki Plugin (extends basic syntax)
Resolution status
New
Submitted by
Nowell VanHoesen
Lastmod by
Nowell VanHoesen
Rating
(0)
Description

Found an bug where including multiple excerpts from the same page would only display the first excerpt. Any subsequent includes would display empty text.

On attempts after the initial one the get_page_info() function is not called.

Solution

Made the following changes to lines 49 thru 67 of wikiplugin_include.php

original wikiplugin_include.php
Copy to clipboard
if ( isset($included_pages[$page]) ) { if ( $included_pages[$page]>=$max_times ) { return "Too many includes\n"; } $included_pages[$page]++; } else { $included_pages[$page] = 1; // only evaluate permission the first time round // evaluate if object or system permissions enables user to see the included page $data = $tikilib->get_page_info($page); $perms = $tikilib->get_perm_object($page, 'wiki page', $data, false); if ($perms['tiki_p_view'] != 'y') { $included_pages[$page] = $max_times; // I think is safer to show nothing instead of a message saying that a page can't be accessed // $text="<b>User $user has no permission to access $page</b><br />"; $text=""; return($text); } }

modified wikiplugin_include.php
Copy to clipboard
if ( isset($included_pages[$page]) ) { if ( $included_pages[$page]>=$max_times ) { return "<b>Too many includes</b>\n"; } $included_pages[$page]++; } else { $included_pages[$page] = 1; // only evaluate permission the first time round // evaluate if object or system permissions enables user to see the included page } $data = $tikilib->get_page_info($page); $perms = $tikilib->get_perm_object($page, 'wiki page', $data, false); if ($perms['tiki_p_view'] != 'y') { $included_pages[$page] = $max_times; // I think is safer to show nothing instead of a message saying that a page can't be accessed // $text="<b>User $user has no permission to access $page</b><br />"; $text="<b>Sorry, you don't have permission to access $page</b><br />\n"; return($text); }
Priority
25
Demonstrate Bug on Tiki 19+
Demonstrate Bug (older Tiki versions)
Ticket ID
2934
Created
Thursday 17 December, 2009 16:05:15 UTC
by Nowell VanHoesen
LastModif
Thursday 17 December, 2009 16:05:15 UTC


Show PHP error messages