Index: trunk/extensions/Widgets/Widgets.php |
— | — | @@ -187,14 +187,14 @@ |
188 | 188 | } |
189 | 189 | |
190 | 190 | // Hide the widget from the parser |
191 | | - $output = '<!-- ENCODED_CONTENT '.base64_encode($output).' -->'; |
| 191 | + $output = 'ENCODED_CONTENT '.base64_encode($output).' END_ENCODED_CONTENT'; |
192 | 192 | return $parser->insertStripItem( $output, $parser->mStripState ); |
193 | 193 | } |
194 | 194 | |
195 | 195 | function processEncodedWidgetOutput( &$out, &$text ) { |
196 | 196 | // Find all hidden content and restore to normal |
197 | 197 | $text = preg_replace( |
198 | | - '/<!-- ENCODED_CONTENT ([0-9a-zA-Z\/+]+=*)* -->/esm', |
| 198 | + '/ENCODED_CONTENT ([0-9a-zA-Z\/+]+=*)* END_ENCODED_CONTENT/esm', |
199 | 199 | 'base64_decode("$1")', |
200 | 200 | $text |
201 | 201 | ); |
— | — | @@ -226,7 +226,14 @@ |
227 | 227 | { |
228 | 228 | $flaggedWidgetArticle = FlaggedArticle::getTitleInstance( $widgetTitle ); |
229 | 229 | $flaggedWidgetArticleRevision = $flaggedWidgetArticle->getStableRev(); |
230 | | - $widgetCode = $flaggedWidgetArticleRevision->getRevText(); |
| 230 | + if ($flaggedWidgetArticleRevision) |
| 231 | + { |
| 232 | + $widgetCode = $flaggedWidgetArticleRevision->getRevText(); |
| 233 | + } |
| 234 | + else |
| 235 | + { |
| 236 | + $widgetCode = ''; |
| 237 | + } |
231 | 238 | } |
232 | 239 | else |
233 | 240 | { |