@@ -21,14 +21,7 @@ class SpecialPvXDecode extends SpecialPage {
21
21
* @return void
22
22
*/
23
23
public function __construct () {
24
- global $ wgRequest , $ wgUser ;
25
-
26
24
parent ::__construct ( 'PvXDecode ' );
27
-
28
- $ this ->wgRequest = $ wgRequest ;
29
- $ this ->wgUser = $ wgUser ;
30
- $ this ->output = $ this ->getOutput ();
31
-
32
25
$ this ->DB = wfGetDB ( DB_PRIMARY );
33
26
34
27
require_once ( GWBBCODE_ROOT . '/gwbbcode.inc.php ' );
@@ -38,22 +31,25 @@ public function __construct() {
38
31
* Main Execute for the Specil Page
39
32
* @param $par - Not used, but expected to be there by mediawiki.
40
33
* @return void - echos to page.
34
+ * @throws MWException
41
35
*/
42
36
public function execute ( $ par = null ) {
43
- $ name = $ this ->wgRequest ->getText ( 'wpName ' );
44
- $ build = $ this ->wgRequest ->getText ( 'wpBuild ' );
37
+ $ request = $ this ->getRequest ();
38
+ $ output = $ this ->getOutput ();
39
+ $ name = $ request ->getText ( 'wpName ' );
40
+ $ build = $ request ->getText ( 'wpBuild ' );
45
41
46
42
if ( $ build ) {
47
- if ( strlen ( $ name ) > 1 ) {
43
+ if ( strlen ( $ name ) >= 1 ) {
48
44
$ rout = template_to_gwbbcode ( $ name . "; " . $ build );
49
45
} else {
50
46
$ rout = template_to_gwbbcode ( $ build );
51
47
}
52
48
53
- $ this -> output ->addWikiText ( "== Preview == " );
54
- $ this -> output ->addWikiText ( "<pvxbig> " . $ rout . "</pvxbig> " );
55
- $ this -> output ->addHtml ( "<br> " );
56
- $ this -> output ->addWikiText ( "== PvXcode == " );
49
+ $ output ->addWikiTextAsContent ( "== Preview == " );
50
+ $ output ->addWikiTextAsContent ( "<pvxbig> " . $ rout . "</pvxbig> " );
51
+ $ output ->addHtml ( "<br> " );
52
+ $ output ->addWikiTextAsContent ( "== PvXcode == " );
57
53
$ out =
58
54
"<p><textarea cols='80' rows='10' wrap='virtual'> \n<pvxbig> \n" . $ rout . "\n</pvxbig> \n</textarea></p> " ;
59
55
@@ -76,15 +72,15 @@ public function execute( $par = null ) {
76
72
}
77
73
$ this ->setHeaders ();
78
74
79
- $ this -> output ->addHtml ( $ out );
75
+ $ output ->addHTML ( $ out );
80
76
}
81
77
82
78
/**
83
79
* Return the group name for this special page.
84
80
*
85
81
* @return string
86
82
*/
87
- protected function getGroupName () {
83
+ protected function getGroupName (): string {
88
84
// Change to display in a different category on Special:SpecialPages.
89
85
return 'pvx ' ;
90
86
}
0 commit comments