Index: branches/REL1_17/phase3/includes/User.php |
— | — | @@ -660,7 +660,7 @@ |
661 | 661 | [$rfc5322_atext\\.]+ # user part which is liberal :p |
662 | 662 | @ # 'apostrophe' |
663 | 663 | [$rfc1034_ldh_str]+ # First domain part |
664 | | - (\\.[$rfc1034_ldh_str]+)+ # Following part prefixed with a dot |
| 664 | + (\\.[$rfc1034_ldh_str]+)* # Following part prefixed with a dot |
665 | 665 | $ # End of string |
666 | 666 | /ix" ; // case Insensitive, eXtended |
667 | 667 | |
Index: branches/REL1_17/phase3/includes/filerepo/File.php |
— | — | @@ -901,7 +901,7 @@ |
902 | 902 | $encName = $db->addQuotes( $this->getName() ); |
903 | 903 | $res = $db->select( array( 'page', 'imagelinks'), |
904 | 904 | array( 'page_namespace', 'page_title', 'page_id', 'page_len', 'page_is_redirect', 'page_latest' ), |
905 | | - array( 'page_id' => 'il_from', 'il_to' => $encName ), |
| 905 | + array( 'page_id=il_from', 'il_to' => $encName ), |
906 | 906 | __METHOD__, |
907 | 907 | $options ); |
908 | 908 | |
Property changes on: branches/REL1_17/phase3/includes/filerepo/File.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
909 | 909 | Merged /trunk/phase3/includes/filerepo/File.php:r80324,80326,80328,80339,80350-80351,80355,80358,80362-80363,80371,80442,80540,80679,80685,80694 |
Index: branches/REL1_17/phase3/includes/installer/WebInstallerPage.php |
— | — | @@ -809,6 +809,14 @@ |
810 | 810 | $this->addHTML( $extHtml ); |
811 | 811 | } |
812 | 812 | |
| 813 | + // Having / in paths in Windows looks funny :) |
| 814 | + $this->setVar( 'wgDeletedDirectory', |
| 815 | + str_replace( |
| 816 | + '/', DIRECTORY_SEPARATOR, |
| 817 | + $this->getVar( 'wgDeletedDirectory' ) |
| 818 | + ) |
| 819 | + ); |
| 820 | + |
813 | 821 | $this->addHTML( |
814 | 822 | # Uploading |
815 | 823 | $this->getFieldSetStart( 'config-upload-settings' ) . |
Property changes on: branches/REL1_17/phase3/includes/installer/WebInstallerPage.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
816 | 824 | Merged /trunk/phase3/includes/installer/WebInstallerPage.php:r80324,80326,80328,80339,80350-80351,80355,80358,80362-80363,80371,80442,80540,80679,80685,80694 |
Index: branches/REL1_17/phase3/includes/api/ApiQueryCategoryMembers.php |
— | — | @@ -65,28 +65,28 @@ |
66 | 66 | $fld_ids = isset( $prop['ids'] ); |
67 | 67 | $fld_title = isset( $prop['title'] ); |
68 | 68 | $fld_sortkey = isset( $prop['sortkey'] ); |
| 69 | + $fld_sortkeyprefix = isset( $prop['sortkeyprefix'] ); |
69 | 70 | $fld_timestamp = isset( $prop['timestamp'] ); |
| 71 | + $fld_type = isset( $prop['type'] ); |
70 | 72 | |
71 | 73 | if ( is_null( $resultPageSet ) ) { |
72 | | - $this->addFields( array( 'cl_from', 'cl_sortkey', 'page_namespace', 'page_title' ) ); |
| 74 | + $this->addFields( array( 'cl_from', 'page_namespace', 'page_title' ) ); |
73 | 75 | $this->addFieldsIf( 'page_id', $fld_ids ); |
| 76 | + $this->addFieldsIf( 'cl_sortkey_prefix', $fld_sortkeyprefix ); |
| 77 | + $this->addFieldsIf( 'cl_sortkey', $fld_sortkey ); |
74 | 78 | } else { |
75 | 79 | $this->addFields( $resultPageSet->getPageTableFields() ); // will include page_ id, ns, title |
76 | 80 | $this->addFields( array( 'cl_from', 'cl_sortkey' ) ); |
77 | 81 | } |
78 | 82 | |
79 | 83 | $this->addFieldsIf( 'cl_timestamp', $fld_timestamp || $params['sort'] == 'timestamp' ); |
| 84 | + $this->addFieldsIf( 'cl_type', $fld_type ); |
| 85 | + |
80 | 86 | $this->addTables( array( 'page', 'categorylinks' ) ); // must be in this order for 'USE INDEX' |
81 | | - // Not needed after bug 10280 is applied to servers |
82 | | - if ( $params['sort'] == 'timestamp' ) { |
83 | | - $this->addOption( 'USE INDEX', 'cl_timestamp' ); |
84 | | - } else { |
85 | | - $this->addOption( 'USE INDEX', 'cl_sortkey' ); |
86 | | - } |
87 | 87 | |
88 | | - $this->addWhere( 'cl_from=page_id' ); |
89 | | - $this->setContinuation( $params['continue'], $params['dir'] ); |
90 | 88 | $this->addWhereFld( 'cl_to', $categoryTitle->getDBkey() ); |
| 89 | + $this->addWhereFld( 'cl_type', $params['type'] ); |
| 90 | + |
91 | 91 | // Scanning large datasets for rare categories sucks, and I already told |
92 | 92 | // how to have efficient subcategory access :-) ~~~~ (oh well, domas) |
93 | 93 | global $wgMiserMode; |
— | — | @@ -96,18 +96,35 @@ |
97 | 97 | } else { |
98 | 98 | $this->addWhereFld( 'page_namespace', $params['namespace'] ); |
99 | 99 | } |
| 100 | + |
| 101 | + $dir = $params['dir'] == 'asc' ? 'newer' : 'older'; |
| 102 | + |
100 | 103 | if ( $params['sort'] == 'timestamp' ) { |
101 | | - $this->addWhereRange( 'cl_timestamp', ( $params['dir'] == 'asc' ? 'newer' : 'older' ), $params['start'], $params['end'] ); |
| 104 | + $this->addWhereRange( 'cl_timestamp', |
| 105 | + $dir, |
| 106 | + $params['start'], |
| 107 | + $params['end'] ); |
| 108 | + |
| 109 | + $this->addOption( 'USE INDEX', 'cl_timestamp' ); |
102 | 110 | } else { |
103 | | - $this->addWhereRange( 'cl_sortkey', ( $params['dir'] == 'asc' ? 'newer' : 'older' ), $params['startsortkey'], $params['endsortkey'] ); |
104 | | - $this->addWhereRange( 'cl_from', ( $params['dir'] == 'asc' ? 'newer' : 'older' ), null, null ); |
| 111 | + // The below produces ORDER BY cl_type, cl_sortkey, cl_from, possibly with DESC added to each of them |
| 112 | + $this->addWhereRange( 'cl_type', $dir, null, null ); |
| 113 | + $this->addWhereRange( 'cl_sortkey', |
| 114 | + $dir, |
| 115 | + $params['startsortkey'], |
| 116 | + $params['endsortkey'] ); |
| 117 | + $this->addWhereRange( 'cl_from', $dir, null, null ); |
| 118 | + $this->addOption( 'USE INDEX', 'cl_sortkey' ); |
105 | 119 | } |
106 | 120 | |
| 121 | + $this->setContinuation( $params['continue'], $params['dir'] ); |
| 122 | + |
| 123 | + $this->addWhere( 'cl_from=page_id' ); |
| 124 | + |
107 | 125 | $limit = $params['limit']; |
108 | 126 | $this->addOption( 'LIMIT', $limit + 1 ); |
109 | 127 | |
110 | 128 | $count = 0; |
111 | | - $lastSortKey = null; |
112 | 129 | $res = $this->select( __METHOD__ ); |
113 | 130 | foreach ( $res as $row ) { |
114 | 131 | if ( ++ $count > $limit ) { |
— | — | @@ -116,7 +133,7 @@ |
117 | 134 | if ( $params['sort'] == 'timestamp' ) { |
118 | 135 | $this->setContinueEnumParameter( 'start', wfTimestamp( TS_ISO_8601, $row->cl_timestamp ) ); |
119 | 136 | } else { |
120 | | - $this->setContinueEnumParameter( 'continue', $this->getContinueStr( $row, $lastSortKey ) ); |
| 137 | + $this->setContinueEnumParameter( 'continue', $row->cl_from ); |
121 | 138 | } |
122 | 139 | break; |
123 | 140 | } |
— | — | @@ -141,6 +158,12 @@ |
142 | 159 | if ( $fld_sortkey ) { |
143 | 160 | $vals['sortkey'] = $row->cl_sortkey; |
144 | 161 | } |
| 162 | + if ( $fld_sortkeyprefix ) { |
| 163 | + $vals['sortkeyprefix'] = $row->cl_sortkey_prefix; |
| 164 | + } |
| 165 | + if ( $fld_type ) { |
| 166 | + $vals['type'] = $row->cl_type; |
| 167 | + } |
145 | 168 | if ( $fld_timestamp ) { |
146 | 169 | $vals['timestamp'] = wfTimestamp( TS_ISO_8601, $row->cl_timestamp ); |
147 | 170 | } |
— | — | @@ -150,14 +173,13 @@ |
151 | 174 | if ( $params['sort'] == 'timestamp' ) { |
152 | 175 | $this->setContinueEnumParameter( 'start', wfTimestamp( TS_ISO_8601, $row->cl_timestamp ) ); |
153 | 176 | } else { |
154 | | - $this->setContinueEnumParameter( 'continue', $this->getContinueStr( $row, $lastSortKey ) ); |
| 177 | + $this->setContinueEnumParameter( 'continue', $row->cl_from ); |
155 | 178 | } |
156 | 179 | break; |
157 | 180 | } |
158 | 181 | } else { |
159 | 182 | $resultPageSet->processDbRow( $row ); |
160 | 183 | } |
161 | | - $lastSortKey = $row->cl_sortkey; // detect duplicate sortkeys |
162 | 184 | } |
163 | 185 | |
164 | 186 | if ( is_null( $resultPageSet ) ) { |
— | — | @@ -166,14 +188,6 @@ |
167 | 189 | } |
168 | 190 | } |
169 | 191 | |
170 | | - private function getContinueStr( $row, $lastSortKey ) { |
171 | | - $ret = $row->cl_sortkey . '|'; |
172 | | - if ( $row->cl_sortkey == $lastSortKey ) { // duplicate sort key, add cl_from |
173 | | - $ret .= $row->cl_from; |
174 | | - } |
175 | | - return $ret; |
176 | | - } |
177 | | - |
178 | 192 | /** |
179 | 193 | * Add DB WHERE clause to continue previous query based on 'continue' parameter |
180 | 194 | */ |
— | — | @@ -182,26 +196,11 @@ |
183 | 197 | return; // This is not a continuation request |
184 | 198 | } |
185 | 199 | |
186 | | - $pos = strrpos( $continue, '|' ); |
187 | | - $sortkey = substr( $continue, 0, $pos ); |
188 | | - $fromstr = substr( $continue, $pos + 1 ); |
189 | | - $from = intval( $fromstr ); |
| 200 | + $encFrom = $this->getDB()->addQuotes( intval( $continue ) ); |
190 | 201 | |
191 | | - if ( $from == 0 && strlen( $fromstr ) > 0 ) { |
192 | | - $this->dieUsage( 'Invalid continue param. You should pass the original value returned by the previous query', 'badcontinue' ); |
193 | | - } |
| 202 | + $op = ( $dir == 'desc' ? '<=' : '>=' ); |
194 | 203 | |
195 | | - $encSortKey = $this->getDB()->addQuotes( $sortkey ); |
196 | | - $encFrom = $this->getDB()->addQuotes( $from ); |
197 | | - |
198 | | - $op = ( $dir == 'desc' ? '<' : '>' ); |
199 | | - |
200 | | - if ( $from != 0 ) { |
201 | | - // Duplicate sort key continue |
202 | | - $this->addWhere( "cl_sortkey$op$encSortKey OR (cl_sortkey=$encSortKey AND cl_from$op=$encFrom)" ); |
203 | | - } else { |
204 | | - $this->addWhere( "cl_sortkey$op=$encSortKey" ); |
205 | | - } |
| 204 | + $this->addWhere( "cl_from $op $encFrom" ); |
206 | 205 | } |
207 | 206 | |
208 | 207 | public function getAllowedParams() { |
— | — | @@ -217,6 +216,8 @@ |
218 | 217 | 'ids', |
219 | 218 | 'title', |
220 | 219 | 'sortkey', |
| 220 | + 'sortkeyprefix', |
| 221 | + 'type', |
221 | 222 | 'timestamp', |
222 | 223 | ) |
223 | 224 | ), |
— | — | @@ -224,6 +225,15 @@ |
225 | 226 | ApiBase::PARAM_ISMULTI => true, |
226 | 227 | ApiBase::PARAM_TYPE => 'namespace', |
227 | 228 | ), |
| 229 | + 'type' => array( |
| 230 | + ApiBase::PARAM_ISMULTI => true, |
| 231 | + ApiBase::PARAM_DFLT => 'page|subcat|file', |
| 232 | + ApiBase::PARAM_TYPE => array( |
| 233 | + 'page', |
| 234 | + 'subcat', |
| 235 | + 'file' |
| 236 | + ) |
| 237 | + ), |
228 | 238 | 'continue' => null, |
229 | 239 | 'limit' => array( |
230 | 240 | ApiBase::PARAM_TYPE => 'limit', |
— | — | @@ -264,12 +274,15 @@ |
265 | 275 | 'title' => 'Which category to enumerate (required). Must include Category: prefix', |
266 | 276 | 'prop' => array( |
267 | 277 | 'What pieces of information to include', |
268 | | - ' ids - Adds the page id', |
269 | | - ' title - Adds the title and namespace id of the page', |
270 | | - ' sortkey - Adds the sortkey used for the category', |
271 | | - ' timestamp - Adds the timestamp of when the page was included', |
| 278 | + ' ids - Adds the page ID', |
| 279 | + ' title - Adds the title and namespace ID of the page', |
| 280 | + ' sortkey - Adds the sortkey used for sorting in the category (may not be human-readble)', |
| 281 | + ' sortkeyprefix - Adds the sortkey prefix used for sorting in the category (human-readable part of the sortkey)', |
| 282 | + ' type - Adds the type that the page has been categorised as (page, subcat or file)', |
| 283 | + ' timestamp - Adds the timestamp of when the page was included', |
272 | 284 | ), |
273 | 285 | 'namespace' => 'Only include pages in these namespaces', |
| 286 | + 'type' => 'What type of category members to include', |
274 | 287 | 'sort' => 'Property to sort by', |
275 | 288 | 'dir' => 'In which direction to sort', |
276 | 289 | 'start' => "Timestamp to start listing from. Can only be used with {$p}sort=timestamp", |
Index: branches/REL1_17/phase3/includes/Namespace.php |
— | — | @@ -128,12 +128,10 @@ |
129 | 129 | static $namespaces = null; |
130 | 130 | if ( $namespaces === null ) { |
131 | 131 | global $wgExtraNamespaces, $wgCanonicalNamespaceNames; |
| 132 | + $namespaces = array( NS_MAIN => '' ) + $wgCanonicalNamespaceNames; |
132 | 133 | if ( is_array( $wgExtraNamespaces ) ) { |
133 | | - $namespaces = $wgCanonicalNamespaceNames + $wgExtraNamespaces; |
134 | | - } else { |
135 | | - $namespaces = $wgCanonicalNamespaceNames; |
| 134 | + $namespaces += $wgExtraNamespaces; |
136 | 135 | } |
137 | | - $namespaces[NS_MAIN] = ''; |
138 | 136 | wfRunHooks( 'CanonicalNamespaces', array( &$namespaces ) ); |
139 | 137 | } |
140 | 138 | return $namespaces; |
Index: branches/REL1_17/phase3/RELEASE-NOTES |
— | — | @@ -492,6 +492,7 @@ |
493 | 493 | === API changes in 1.17 === |
494 | 494 | * BREAKING CHANGE: action=patrol now requires POST |
495 | 495 | * BREAKING CHANGE: patrol token is no longer the same as edit token |
| 496 | +* (bug 24650) Fix API to work with categorylinks changes |
496 | 497 | |
497 | 498 | * (bug 22738) Allow filtering by action type on query=logevent. |
498 | 499 | * (bug 22764) uselang parameter for action=parse. |
Property changes on: branches/REL1_17/phase3/RELEASE-NOTES |
___________________________________________________________________ |
Modified: svn:mergeinfo |
499 | 500 | Merged /trunk/phase3/RELEASE-NOTES:r80324,80326,80328,80339,80350-80351,80355,80358,80362-80363,80371,80442,80540,80679,80685,80694 |