| Conditions | 5 |
| Paths | 6 |
| Total Lines | 30 |
| Code Lines | 18 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 34 | public function preProcess() { |
||
| 35 | if(!checkSecurityToken()) throw new ActionException(); |
||
| 36 | |||
| 37 | global $ID; |
||
| 38 | global $REV; |
||
| 39 | global $lang; |
||
| 40 | |||
| 41 | // when no revision is given, delete current one |
||
| 42 | // FIXME this feature is not exposed in the GUI currently |
||
| 43 | $text = ''; |
||
| 44 | $sum = $lang['deleted']; |
||
| 45 | if($REV) { |
||
| 46 | $text = rawWiki($ID, $REV); |
||
| 47 | if(!$text) throw new ActionException(); //something went wrong |
||
| 48 | $sum = sprintf($lang['restored'], dformat($REV)); |
||
| 49 | } |
||
| 50 | |||
| 51 | // spam check |
||
| 52 | if(checkwordblock($text)) { |
||
| 53 | msg($lang['wordblock'], -1); |
||
| 54 | throw new ActionException('edit'); |
||
| 55 | } |
||
| 56 | |||
| 57 | saveWikiText($ID, $text, $sum, false); |
||
| 58 | msg($sum, 1); |
||
| 59 | $REV = ''; |
||
| 60 | |||
| 61 | // continue with draftdel -> redirect -> show |
||
| 62 | throw new ActionAbort('draftdel'); |
||
| 63 | } |
||
| 64 | |||
| 66 |