Extension talk:CreateArticle/sourcecode

Mediawiki 1.8.2 and 1.9.3 issue
I had to add a "trim" to the expression "$value=htmlspecialchars($matches[1]);" i.e. trim($value=htmlspecialchars($matches[1])); in order to make this extension work. It would always declare "type not specified".

It may be due to a change in how the function htmlspecialchars is defined in MW 1.6.9, where this extension was tested.

/* Parses tag input arguments */ function getCreateBoxOption(&$value,&$input,$name,$isNumber=false) { if(preg_match("/^\s*$name\s*=\s*(.*)/mi",$input,$matches)) { if($isNumber) { $value=intval($matches[1]); } else { $value=htmlspecialchars($matches[1]); }       } }

class Createbox { var $type,$prefix, $subpage, $width; var $preload,$editintro, $bgcolor; var $defaulttext,$buttonlabel; var $align, $br, $hidden;

function CreateBox( &$parser ) { $this->parser =& $parser; }

function render { if($this->type=='createarticle'){ return $this->getCreateForm; } else { return false; }       }

Hope this helps, Jean-Lou Dupont 18:35, 17 March 2007 (UTC)