Thread:Extension talk:AJAXPoll/Does not work properly within templates/reply

Here is a fix: git diff AJAXPoll_body.php diff --git a/AJAXPoll_body.php b/AJAXPoll_body.php index a6fcb45..82f3d81 100644 --- a/AJAXPoll_body.php +++ b/AJAXPoll_body.php @@ -28,8 +28,13 @@ class AJAXPoll { return true; } +# from Version 1.16 http://www.mediawiki.org/wiki/Manual:Tag_extensions/de +#function wfSampleWonderfulHook( $text, array $args, Parser $parser, PPFrame $f +#$output = $parser->recursiveTagParse( $text, $frame ); +#return ' ' . $output . ' '; +       # The callback function for converting the input text to HTML output -       static function AJAXPollRender( $input, $args = array, Parser $parser +      static function AJAXPollRender( $input, $args = array, Parser $parser,                global $wgUser, $wgOut, $wgTitle, $wgScriptPath, $wgUseAjax;                $parser->disableCache; @@ -44,9 +49,12 @@ class AJAXPoll {                // ID of the poll                $id = strtoupper( md5( $input ) ); -               $par = new Parser; -               $input = $par->parse( $input, $wgTitle, $wgOut->parserOptions -              $input = trim( strip_tags( $input->getText ) ); +              // get the input +              $input = $parser->recursiveTagParse( $input, $frame ); +              wfDebug("input before trim: '".$input."'\n"); +              // now input will be a string ... +              $input = trim( strip_tags( $input ) ); +              wfDebug("input after trim: '".$input."'\n"); $lines = explode( "\n", trim( $input ) ); // compatibility for non-ajax requests - just in case