@@ -30,8 +30,14 @@ function _edit_form(Doku_Event $event, $param) {
30
30
function _action_act_preprocess (Doku_Event $ event , $ param ) {
31
31
global $ ACT ;
32
32
global $ INFO ;
33
+ ;
34
+ $ action =& $ event ->data ;
33
35
34
- if ($ event ->data != 'changes ' ) return ;
36
+ if (!( /* Valid cases */
37
+ $ action == 'changes ' // Greebo
38
+ // Frusterick Manners and below... probably
39
+ || is_array ($ action ) && array_key_exists ('changes ' , $ action )
40
+ )) return ;
35
41
36
42
/* Check for DokuWiki release Greebo and above */
37
43
if (class_exists ('\\dokuwiki \\ActionRouter ' , false )) {
@@ -41,18 +47,19 @@ function _action_act_preprocess(Doku_Event $event, $param) {
41
47
$ this ->savedraft ();
42
48
$ ae ->preProcess ();
43
49
50
+ $ event ->stopPropagation ();
44
51
$ event ->preventDefault ();
45
- }
46
- else if ( ' preview ' == act_permcheck ( ' preview ' )
47
- && 'preview ' == act_draftsave ('preview ' )
48
- && $ INFO [ ' editable ' ]
49
- && ' preview ' == act_edit ( ' preview ' )) {
50
- // DokuWiki releases before Greebo
52
+ } else /* DokuWiki release Frusterick Manners or below */
53
+ // Same setup as preview: permissions and environment
54
+ if ( 'preview ' == act_permcheck ('preview ' )
55
+ && ' preview ' == act_edit ( ' preview ' ))
56
+ {
57
+ act_draftsave ( ' preview ' );
51
58
$ ACT = 'changes ' ;
52
- $ event ->stoppropagation ();
59
+
60
+ $ event ->stopPropagation ();
53
61
$ event ->preventDefault ();
54
- $ this ->_change_headers = true ;
55
- }else {
62
+ } else {
56
63
$ ACT = 'preview ' ;
57
64
}
58
65
}
0 commit comments