Index: trunk/extensions/SemanticForms/includes/SF_FormField.php |
— | — | @@ -6,8 +6,8 @@ |
7 | 7 | */ |
8 | 8 | |
9 | 9 | /** |
10 | | - * This class is distinct from SFTemplateField in that it represents a |
11 | | - * template field defined in a form - it contains a SFTemplateField object |
| 10 | + * This class is distinct from SFTemplateField in that it represents a template |
| 11 | + * field defined in a form definition - it contains a SFTemplateField object |
12 | 12 | * within it (the $template_field variable), along with the other properties |
13 | 13 | * for that field that are set within the form |
14 | 14 | * @ingroup SF |
Index: trunk/extensions/SemanticForms/includes/SF_AutoeditAPI.php |
— | — | @@ -18,7 +18,7 @@ |
19 | 19 | */ |
20 | 20 | class SFAutoeditAPI extends ApiBase { |
21 | 21 | |
22 | | - private $mOptions; |
| 22 | + private $mOptions = array(); |
23 | 23 | private $mIsApiQuery = true; |
24 | 24 | |
25 | 25 | /** |
— | — | @@ -83,7 +83,11 @@ |
84 | 84 | $parseroptions->enableLimitReport( false ); |
85 | 85 | |
86 | 86 | |
87 | | - return $wgParser->parse( $result, $title, $parseroptions )->getText(); |
| 87 | + $result = new AjaxResponse($wgParser->parse( $result, $title, $parseroptions )->getText()); |
| 88 | + $result->setResponseCode('400 Bad Request'); |
| 89 | + $result->setContentType('text/html'); |
| 90 | + |
| 91 | + return $result; |
88 | 92 | } |
89 | 93 | |
90 | 94 | /** |
— | — | @@ -482,7 +486,7 @@ |
483 | 487 | // $toplevel: if this is a toplevel value. |
484 | 488 | private function addToArray( &$array, $key, $value, $toplevel = true ) { |
485 | 489 | $matches = array(); |
486 | | - |
| 490 | + |
487 | 491 | if ( preg_match( '/^([^\[\]]*)\[([^\[\]]*)\](.*)/', $key, $matches ) ) { |
488 | 492 | |
489 | 493 | // for some reason toplevel keys get their spaces encoded by MW. |
— | — | @@ -547,8 +551,8 @@ |
548 | 552 | * @param String $msg |
549 | 553 | */ |
550 | 554 | private function reportError( $msg ) { |
551 | | - header( 'HTTP/Status: 400 Bad Request' ); |
552 | 555 | if ( $this->isApiQuery() ) { |
| 556 | + header( 'HTTP/Status: 400 Bad Request' ); |
553 | 557 | $this->getResult()->addValue( null, 'result', array('code' => '400', '*' => $msg) ); |
554 | 558 | } |
555 | 559 | return $msg; |