Index: trunk/extensions/CodeReview/ui/CodeRevisionListView.php |
— | — | @@ -15,14 +15,26 @@ |
16 | 16 | parent::__construct( $repo ); |
17 | 17 | global $wgRequest; |
18 | 18 | |
19 | | - $this->mPath = htmlspecialchars( trim( $wgRequest->getVal( 'path' ) ) ); |
20 | | - if ( strlen( $this->mPath ) && $this->mPath[0] !== '/' ) { |
21 | | - $this->mPath = "/{$this->mPath}"; // make sure this is a valid path |
22 | | - } |
| 19 | + $this->mPath = array_map( array( $this, 'preparePaths' ), explode( '|', $wgRequest->getVal( 'path' ) ) ); |
| 20 | + |
23 | 21 | $this->mAuthor = $wgRequest->getText( 'author' ); |
24 | 22 | $this->mAppliedFilter = null; |
25 | 23 | } |
26 | 24 | |
| 25 | + /** |
| 26 | + * @param string $path |
| 27 | + * @return string |
| 28 | + */ |
| 29 | + function preparePaths( $path ) { |
| 30 | + $path = trim( $path ); |
| 31 | + $path = rtrim( $path, '/' ); |
| 32 | + $path = htmlspecialchars( $path ); |
| 33 | + if ( strlen( $path ) && $path[0] !== '/' ) { |
| 34 | + $path = "/{$path}"; // make sure this is a valid path |
| 35 | + } |
| 36 | + return $path; |
| 37 | + } |
| 38 | + |
27 | 39 | function execute() { |
28 | 40 | global $wgOut, $wgUser, $wgRequest, $wgLang; |
29 | 41 | if ( !$this->mRepo ) { |
— | — | @@ -166,7 +178,7 @@ |
167 | 179 | $ret = Xml::openElement( 'form', array( 'action' => $wgScript, 'method' => 'get' ) ) . |
168 | 180 | "<fieldset><legend>" . wfMsgHtml( 'code-pathsearch-legend' ) . "</legend>" . |
169 | 181 | '<table width="100%"><tr><td>' . |
170 | | - Xml::inputlabel( wfMsg( "code-pathsearch-path" ), 'path', 'path', 55, $this->mPath ) . |
| 182 | + Xml::inputlabel( wfMsg( "code-pathsearch-path" ), 'path', 'path', 55, implode( '|', $this->mPath ) ) . |
171 | 183 | ' ' . Xml::submitButton( wfMsg( 'allpagessubmit' ) ) . |
172 | 184 | '</td>'; |
173 | 185 | |
— | — | @@ -228,7 +240,7 @@ |
229 | 241 | } |
230 | 242 | |
231 | 243 | function getDefaultSort() { |
232 | | - return strlen( $this->mView->mPath ) ? 'cp_rev_id' : 'cr_id'; |
| 244 | + return count( $this->mView->mPath ) ? 'cp_rev_id' : 'cr_id'; |
233 | 245 | } |
234 | 246 | |
235 | 247 | function getQueryInfo() { |
— | — | @@ -309,7 +321,7 @@ |
310 | 322 | |
311 | 323 | function formatRevValue( $name, $value, $row ) { |
312 | 324 | global $wgLang; |
313 | | - $pathQuery = ( strlen( $this->mView->mPath ) ) ? array( 'path' => $this->mView->mPath ) : array(); |
| 325 | + $pathQuery = count( $this->mView->mPath ) ? array( 'path' => $this->mView->mPath ) : array(); |
314 | 326 | |
315 | 327 | switch( $name ) { |
316 | 328 | case 'selectforchange': |