Index: trunk/extensions/EtherpadLite/EtherpadLite.php |
— | — | @@ -87,9 +87,11 @@ |
88 | 88 | $wgEtherpadLiteShowChat = true; |
89 | 89 | $wgEtherpadLiteShowAuthorColors = true; |
90 | 90 | |
91 | | -function wfEtherpadLiteTestAndReturnBoolean( $var, $default ) { |
| 91 | + |
| 92 | +function wfEtherpadLiteStringFromTestedBoolean( $var, $default ) { |
92 | 93 | # http://www.php.net/manual/en/function.is-bool.php#104643 |
93 | | - return ( isset( $var ) ) ? filter_var( $var, FILTER_VALIDATE_BOOLEAN ) : $default; |
| 94 | + $booleanVar = ( isset( $var ) ) ? filter_var( $var, FILTER_VALIDATE_BOOLEAN ) : $default; |
| 95 | + return ( $booleanVar ) ? "true" : "false"; |
94 | 96 | } |
95 | 97 | |
96 | 98 | function wfEtherpadLiteRender( $input, $args, $parser, $frame ) { |
— | — | @@ -103,11 +105,11 @@ |
104 | 106 | $height = ( isset( $args['height'] ) ) ? $args['height'] : $wgEtherpadLiteDefaultHeight; |
105 | 107 | $width = ( isset( $args['width'] ) ) ? $args['width'] : $wgEtherpadLiteDefaultWidth; |
106 | 108 | |
107 | | - $useMonospaceFont = wfEtherpadLiteTestAndReturnBoolean( $args['monospaced-font'], $wgEtherpadLiteMonospacedFont ); |
108 | | - $showControls = wfEtherpadLiteTestAndReturnBoolean( $args['show-controls'], $wgEtherpadLiteShowControls ) ; |
109 | | - $showLineNumbers = wfEtherpadLiteTestAndReturnBoolean( $args['show-linenumbers'], $wgEtherpadLiteShowLineNumbers ); |
110 | | - $showChat = wfEtherpadLiteTestAndReturnBoolean( $args['show-chat'], $wgEtherpadLiteShowChat ); |
111 | | - $noColors = ! ( wfEtherpadLiteTestAndReturnBoolean( $args['show-colors'], $wgEtherpadLiteShowAuthorColors ) ); |
| 109 | + $useMonospaceFont = wfEtherpadLiteStringFromTestedBoolean( $args['monospaced-font'], $wgEtherpadLiteMonospacedFont ); |
| 110 | + $showControls = wfEtherpadLiteStringFromTestedBoolean( $args['show-controls'], $wgEtherpadLiteShowControls ) ; |
| 111 | + $showLineNumbers = wfEtherpadLiteStringFromTestedBoolean( $args['show-linenumbers'], $wgEtherpadLiteShowLineNumbers ); |
| 112 | + $showChat = wfEtherpadLiteStringFromTestedBoolean( $args['show-chat'], $wgEtherpadLiteShowChat ); |
| 113 | + $noColors = ! ( wfEtherpadLiteStringFromTestedBoolean( $args['show-colors'], $wgEtherpadLiteShowAuthorColors ) ); |
112 | 114 | |
113 | 115 | $epliteHostUrl = Sanitizer::cleanUrl ( |
114 | 116 | ( isset( $args['pad-url'] ) ) ? $args['pad-url'] : $wgEtherpadLiteDefaultPadUrl |