Index: trunk/phase3/includes/api/ApiBase.php |
— | — | @@ -38,15 +38,15 @@ |
39 | 39 | */ |
40 | 40 | abstract class ApiBase { |
41 | 41 | |
42 | | - // These constants allow modules to specify exactly how to treat incomming parameters. |
| 42 | + // These constants allow modules to specify exactly how to treat incoming parameters. |
43 | 43 | |
44 | 44 | const PARAM_DFLT = 0; // Default value of the parameter |
45 | | - const PARAM_ISMULTI = 1; // Boolean, do we accept more than one item for this parameters (ie: titles) |
46 | | - const PARAM_TYPE = 2; // Can be either a string type (ie: 'integer') or an array of allowed values |
47 | | - const PARAM_MAX = 3; // Max value allowed for a parameter |
48 | | - const PARAM_MAX2 = 4; // Max value allowed for a parameter (similar to the upper limits below) |
49 | | - const PARAM_MIN = 5; // Lowest value allowed for a parameter |
50 | | - const PARAM_ALLOW_DUPLICATES = 6; |
| 45 | + const PARAM_ISMULTI = 1; // Boolean, do we accept more than one item for this parameter (e.g.: titles)? |
| 46 | + const PARAM_TYPE = 2; // Can be either a string type (e.g.: 'integer') or an array of allowed values |
| 47 | + const PARAM_MAX = 3; // Max value allowed for a parameter. Only applies if TYPE='integer' |
| 48 | + const PARAM_MAX2 = 4; // Max value allowed for a parameter for bots and sysops. Only applies if TYPE='integer' |
| 49 | + const PARAM_MIN = 5; // Lowest value allowed for a parameter. Only applies if TYPE='integer' |
| 50 | + const PARAM_ALLOW_DUPLICATES = 6; // Boolean, do we allow the same value to be set more than once when ISMULTI=true |
51 | 51 | |
52 | 52 | const LIMIT_BIG1 = 500; // Fast query, std user limit |
53 | 53 | const LIMIT_BIG2 = 5000; // Fast query, bot/sysop limit |
— | — | @@ -147,7 +147,7 @@ |
148 | 148 | /** |
149 | 149 | * Get the result data array |
150 | 150 | */ |
151 | | - public function & getResultData() { |
| 151 | + public function getResultData() { |
152 | 152 | return $this->getResult()->getData(); |
153 | 153 | } |
154 | 154 | |
— | — | @@ -156,20 +156,23 @@ |
157 | 157 | * notice any changes in API. |
158 | 158 | */ |
159 | 159 | public function setWarning($warning) { |
160 | | - # If there is a warning already, append it to the existing one |
161 | | - $data =& $this->getResult()->getData(); |
| 160 | + $data = $this->getResult()->getData(); |
162 | 161 | if(isset($data['warnings'][$this->getModuleName()])) |
163 | 162 | { |
164 | 163 | # Don't add duplicate warnings |
165 | 164 | $warn_regex = preg_quote($warning, '/'); |
166 | 165 | if(preg_match("/{$warn_regex}(\\n|$)/", $data['warnings'][$this->getModuleName()]['*'])) |
167 | 166 | return; |
168 | | - $warning = "{$data['warnings'][$this->getModuleName()]['*']}\n$warning"; |
169 | | - unset($data['warnings'][$this->getModuleName()]); |
| 167 | + $oldwarning = $data['warnings'][$this->getModuleName()]['*']; |
| 168 | + # If there is a warning already, append it to the existing one |
| 169 | + $warning = "$oldwarning\n$warning"; |
| 170 | + $this->getResult()->unsetValue('warnings', $this->getModuleName()); |
170 | 171 | } |
171 | 172 | $msg = array(); |
172 | 173 | ApiResult :: setContent($msg, $warning); |
| 174 | + $this->getResult()->disableSizeCheck(); |
173 | 175 | $this->getResult()->addValue('warnings', $this->getModuleName(), $msg); |
| 176 | + $this->getResult()->enableSizeCheck(); |
174 | 177 | } |
175 | 178 | |
176 | 179 | /** |