Conditions | 6 |
Paths | 4 |
Total Lines | 34 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
28 | public function preProcess() { |
||
29 | if(!checkSecurityToken()) throw new ActionException('preview'); |
||
30 | |||
31 | global $ID; |
||
32 | global $DATE; |
||
33 | global $PRE; |
||
34 | global $TEXT; |
||
35 | global $SUF; |
||
36 | global $SUM; |
||
37 | global $lang; |
||
38 | global $INFO; |
||
39 | global $INPUT; |
||
40 | |||
41 | //spam check |
||
42 | if(checkwordblock()) { |
||
43 | msg($lang['wordblock'], -1); |
||
44 | throw new ActionException('edit'); |
||
45 | } |
||
46 | //conflict check |
||
47 | if($DATE != 0 |
||
48 | && isset($INFO['meta']['date']['modified']) |
||
49 | && $INFO['meta']['date']['modified'] > $DATE |
||
50 | ) { |
||
51 | throw new ActionException('conflict'); |
||
52 | } |
||
53 | |||
54 | //save it |
||
55 | saveWikiText($ID, con($PRE, $TEXT, $SUF, true), $SUM, $INPUT->bool('minor')); //use pretty mode for con |
||
56 | //unlock it |
||
57 | unlock($ID); |
||
58 | |||
59 | // continue with draftdel -> redirect -> show |
||
60 | throw new ActionAbort('draftdel'); |
||
61 | } |
||
62 | |||
64 |