Summary: Restore in Page History does not preview
Created: 2009-03-11 15:06
Status: Closed (fixed for 2.2.1)
Category: Bug
From: Diafygi
Priority: 1
Version: 2.2.0
OS: any/any/any

Description: The "Restore" link on the History page (generated with ?action=diff) includes the ?preview=y option. However, when the edit page loads with the restored text, a preview is not displayed.

This is because in /pmwiki.php the condition for showing a preview depends on $_POST['preview'], but not $_GET['preview']. Also, in /scripts/forms.php the condition for e_preview needs to be changed from $_POST.

To fix, $_REQUEST should be used instead of $_POST.

Diff to correct pmwiki.php:

<   if (@$_POST['preview']) {
>   if (@$_REQUEST['preview']) {


< $Conditions['e_preview'] = '(boolean)$_POST["preview"]';
> $Conditions['e_preview'] = '(boolean)$_REQUEST["preview"]';

Thanks, fixed in SVN for the next version. --Petko March 11, 2009, at 03:41 PM