| Index: trunk/phase3/includes/api/ApiParse.php |
| — | — | @@ -111,6 +111,16 @@ |
| 112 | 112 | $titleObj = Title::newFromText($title); |
| 113 | 113 | if(!$titleObj) |
| 114 | 114 | $titleObj = Title::newFromText("API"); |
| | 115 | + if($params['pst'] || $params['onlypst']) |
| | 116 | + $text = $wgParser->preSaveTransform($text, $titleObj, $wgUser, $popts); |
| | 117 | + if($params['onlypst']) |
| | 118 | + { |
| | 119 | + // Build a result and bail out |
| | 120 | + $result_array['text'] = array(); |
| | 121 | + $this->getResult()->setContent($result_array['text'], $text); |
| | 122 | + $this->getResult()->addValue(null, $this->getModuleName(), $result_array); |
| | 123 | + return; |
| | 124 | + } |
| 115 | 125 | $p_result = $wgParser->parse($text, $titleObj, $popts); |
| 116 | 126 | } |
| 117 | 127 | |
| — | — | @@ -222,7 +232,9 @@ |
| 223 | 233 | 'sections', |
| 224 | 234 | 'revid' |
| 225 | 235 | ) |
| 226 | | - ) |
| | 236 | + ), |
| | 237 | + 'pst' => false, |
| | 238 | + 'onlypst' => false, |
| 227 | 239 | ); |
| 228 | 240 | } |
| 229 | 241 | |
| — | — | @@ -236,6 +248,12 @@ |
| 237 | 249 | 'prop' => array('Which pieces of information to get.', |
| 238 | 250 | 'NOTE: Section tree is only generated if there are more than 4 sections, or if the __TOC__ keyword is present' |
| 239 | 251 | ), |
| | 252 | + 'pst' => array( 'Do a pre-save transform on the input before parsing it.', |
| | 253 | + 'Ignored if page or oldid is used.' |
| | 254 | + ), |
| | 255 | + 'onlypst' => array('Do a PST on the input, but don\'t parse it.', |
| | 256 | + 'Returns PSTed wikitext. Ignored if page or oldid is used.' |
| | 257 | + ), |
| 240 | 258 | ); |
| 241 | 259 | } |
| 242 | 260 | |
| Index: trunk/phase3/includes/api/ApiQueryLogEvents.php |
| — | — | @@ -140,7 +140,7 @@ |
| 141 | 141 | $this->getResult()->addValue('query', $this->getModuleName(), $data); |
| 142 | 142 | } |
| 143 | 143 | |
| 144 | | - public static function addLogParams($result, &$vals, $params, $type) { |
| | 144 | + public static function addLogParams($result, &$vals, $params, $type, $ts) { |
| 145 | 145 | $params = explode("\n", $params); |
| 146 | 146 | switch ($type) { |
| 147 | 147 | case 'move': |
| — | — | @@ -169,6 +169,8 @@ |
| 170 | 170 | case 'block': |
| 171 | 171 | $vals2 = array(); |
| 172 | 172 | list( $vals2['duration'], $vals2['flags'] ) = $params; |
| | 173 | + $vals2['expiry'] = wfTimestamp(TS_ISO_8601, |
| | 174 | + strtotime($params[0], wfTimestamp(TS_UNIX, $ts))); |
| 173 | 175 | $vals[$type] = $vals2; |
| 174 | 176 | $params = null; |
| 175 | 177 | break; |
| — | — | @@ -200,7 +202,8 @@ |
| 201 | 203 | |
| 202 | 204 | if ($this->fld_details && $row->log_params !== '') { |
| 203 | 205 | self::addLogParams($this->getResult(), $vals, |
| 204 | | - $row->log_params, $row->log_type); |
| | 206 | + $row->log_params, $row->log_type, |
| | 207 | + $row->log_timestamp); |
| 205 | 208 | } |
| 206 | 209 | |
| 207 | 210 | if ($this->fld_user) { |
| Index: trunk/phase3/includes/api/ApiQueryWatchlist.php |
| — | — | @@ -118,7 +118,6 @@ |
| 119 | 119 | |
| 120 | 120 | $this->addTables(array ( |
| 121 | 121 | 'watchlist', |
| 122 | | - 'page', |
| 123 | 122 | 'recentchanges' |
| 124 | 123 | )); |
| 125 | 124 | |
| — | — | @@ -126,14 +125,18 @@ |
| 127 | 126 | $this->addWhere(array ( |
| 128 | 127 | 'wl_namespace = rc_namespace', |
| 129 | 128 | 'wl_title = rc_title', |
| 130 | | - 'rc_cur_id = page_id', |
| 131 | 129 | 'wl_user' => $userId, |
| 132 | 130 | 'rc_deleted' => 0, |
| 133 | 131 | )); |
| 134 | 132 | |
| 135 | 133 | $this->addWhereRange('rc_timestamp', $dir, $start, $end); |
| 136 | 134 | $this->addWhereFld('wl_namespace', $namespace); |
| 137 | | - $this->addWhereIf('rc_this_oldid=page_latest', !$allrev); |
| | 135 | + if(!$allrev) |
| | 136 | + { |
| | 137 | + $this->addTables('page'); |
| | 138 | + $this->addWhere('page_id=rc_cur_id'); |
| | 139 | + $this->addWhereIf('rc_this_oldid=page_latest'); |
| | 140 | + } |
| 138 | 141 | |
| 139 | 142 | if (!is_null($show)) { |
| 140 | 143 | $show = array_flip($show); |
| Index: trunk/phase3/RELEASE-NOTES |
| — | — | @@ -482,6 +482,7 @@ |
| 483 | 483 | * (bug 16516) Made rvsection=T-2 work |
| 484 | 484 | * (bug 16526) Added usprop=emailable to list=users |
| 485 | 485 | * (bug 16548) list=search threw errors with an invalid error code |
| | 486 | +* (bug 16515) Added pst and onlypst parameters to action=parse |
| 486 | 487 | |
| 487 | 488 | === Languages updated in 1.14 === |
| 488 | 489 | |