| Index: trunk/phase3/includes/api/ApiQueryPageProps.php |
| — | — | @@ -72,7 +72,7 @@ |
| 73 | 73 | |
| 74 | 74 | |
| 75 | 75 | foreach ( $this->everything as $pageid => $title ) { |
| 76 | | - $pageInfo = $this->extractPageInfo( $pageid, $title ); |
| | 76 | + $pageInfo = $this->extractPageInfo( $pageid, $title, $prop ); |
| 77 | 77 | $fit = $result->addValue( array( |
| 78 | 78 | 'query', |
| 79 | 79 | 'pages' |
| — | — | @@ -92,7 +92,7 @@ |
| 93 | 93 | * @param $title Title object |
| 94 | 94 | * @return array |
| 95 | 95 | */ |
| 96 | | - private function extractPageInfo( $pageid, $title ) { |
| | 96 | + private function extractPageInfo( $pageid, $title, $prop ) { |
| 97 | 97 | global $wgPageProps; |
| 98 | 98 | |
| 99 | 99 | $pageInfo = array(); |
| — | — | @@ -121,7 +121,7 @@ |
| 122 | 122 | return $pageInfo; |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | | - public function getCacheMode( $params ) { |
| | 125 | + public function getCacheMode() { |
| 126 | 126 | return 'public'; |
| 127 | 127 | } |
| 128 | 128 | |
| — | — | @@ -148,6 +148,9 @@ |
| 149 | 149 | 'continue' => 'When more results are available, use this to continue', |
| 150 | 150 | ); |
| 151 | 151 | |
| | 152 | + //This mess of code first gets the length of the biggest propname, and adds two onto it to make |
| | 153 | + //the number of characters should be used before the dash. If the biggest propname is shorter than 12 characters, |
| | 154 | + //the number of characters before the dash become 14. |
| 152 | 155 | $maxLen = max( array_map( 'strlen', array_keys( $wgPageProps ) ) ); |
| 153 | 156 | $matchLen = $maxLen + 2; |
| 154 | 157 | if( $maxLen < 12 ) { |