Index: branches/REL1_14/phase3/includes/api/ApiQueryInfo.php |
— | — | @@ -212,6 +212,38 @@ |
213 | 213 | if($row->pr_cascade) |
214 | 214 | $a['cascade'] = ''; |
215 | 215 | $protections[$row->pr_page][] = $a; |
| 216 | + |
| 217 | + # Also check old restrictions |
| 218 | + if($pageRestrictions[$row->pr_page]) { |
| 219 | + foreach(explode(':', trim($pageRestrictions[$pageid])) as $restrict) { |
| 220 | + $temp = explode('=', trim($restrict)); |
| 221 | + if(count($temp) == 1) { |
| 222 | + // old old format should be treated as edit/move restriction |
| 223 | + $restriction = trim( $temp[0] ); |
| 224 | + if($restriction == '') |
| 225 | + continue; |
| 226 | + $protections[$row->pr_page][] = array( |
| 227 | + 'type' => 'edit', |
| 228 | + 'level' => $restriction, |
| 229 | + 'expiry' => 'infinity', |
| 230 | + ); |
| 231 | + $protections[$row->pr_page][] = array( |
| 232 | + 'type' => 'move', |
| 233 | + 'level' => $restriction, |
| 234 | + 'expiry' => 'infinity', |
| 235 | + ); |
| 236 | + } else { |
| 237 | + $restriction = trim( $temp[1] ); |
| 238 | + if($restriction == '') |
| 239 | + continue; |
| 240 | + $protections[$row->pr_page][] = array( |
| 241 | + 'type' => $temp[0], |
| 242 | + 'level' => $restriction, |
| 243 | + 'expiry' => 'infinity', |
| 244 | + ); |
| 245 | + } |
| 246 | + } |
| 247 | + } |
216 | 248 | } |
217 | 249 | $db->freeResult($res); |
218 | 250 | |
— | — | @@ -420,34 +452,6 @@ |
421 | 453 | $pageInfo['protection'] = $protections[$pageid]; |
422 | 454 | $result->setIndexedTagName($pageInfo['protection'], 'pr'); |
423 | 455 | } |
424 | | - # Also check old restrictions |
425 | | - if( $pageRestrictions[$pageid] ) { |
426 | | - foreach( explode( ':', trim( $pageRestrictions[$pageid] ) ) as $restrict ) { |
427 | | - $temp = explode( '=', trim( $restrict ) ); |
428 | | - if(count($temp) == 1) { |
429 | | - // old old format should be treated as edit/move restriction |
430 | | - $restriction = trim( $temp[0] ); |
431 | | - $pageInfo['protection'][] = array( |
432 | | - 'type' => 'edit', |
433 | | - 'level' => $restriction, |
434 | | - 'expiry' => 'infinity', |
435 | | - ); |
436 | | - $pageInfo['protection'][] = array( |
437 | | - 'type' => 'move', |
438 | | - 'level' => $restriction, |
439 | | - 'expiry' => 'infinity', |
440 | | - ); |
441 | | - } else { |
442 | | - $restriction = trim( $temp[1] ); |
443 | | - $pageInfo['protection'][] = array( |
444 | | - 'type' => $temp[0], |
445 | | - 'level' => $restriction, |
446 | | - 'expiry' => 'infinity', |
447 | | - ); |
448 | | - } |
449 | | - } |
450 | | - $result->setIndexedTagName($pageInfo['protection'], 'pr'); |
451 | | - } |
452 | 456 | } |
453 | 457 | if($fld_talkid && isset($talkids[$title->getNamespace()][$title->getDBKey()])) |
454 | 458 | $pageInfo['talkid'] = $talkids[$title->getNamespace()][$title->getDBKey()]; |
Index: branches/REL1_14/phase3/RELEASE-NOTES |
— | — | @@ -20,6 +20,8 @@ |
21 | 21 | |
22 | 22 | === API changes in 1.14rc1 === |
23 | 23 | * (bug 16798) JSON encoding errors for some characters outside the BMP |
| 24 | +* (bug 16629) prop=info&inprop=protection lists empty legacy protections |
| 25 | + incorrectly |
24 | 26 | |
25 | 27 | === Configuration changes in 1.14 === |
26 | 28 | |