Index: trunk/extensions/RecordAdmin/RecordAdmin_body.php |
— | — | @@ -46,7 +46,7 @@ |
47 | 47 | if ( is_object( $title ) && $title->isRedirect() ) { |
48 | 48 | $article = new Article( $title ); |
49 | 49 | $content = $article->getContent(); |
50 | | - if ( preg_match( '/\[\[(.+?)\]\]/', $content, $m ) ) $title = Title::newFromText( $m[1] ); |
| 50 | + if ( preg_match( "|\[\[(.+?)\]\]|", $content, $m ) ) $title = Title::newFromText( $m[1] ); |
51 | 51 | } |
52 | 52 | |
53 | 53 | if ( is_object( $title ) ) { |
— | — | @@ -131,7 +131,7 @@ |
132 | 132 | $this->template = Title::makeTitle( NS_TEMPLATE, $type ); |
133 | 133 | |
134 | 134 | if ( $type && $wgRecordAdminUseNamespaces ) { |
135 | | - if ( $wpTitle && !ereg( "^$type:.+$", $wpTitle ) ) $wpTitle = "$type:$wpTitle"; |
| 135 | + if ( $wpTitle && !preg_match( "|^$type:.+$|", $wpTitle ) ) $wpTitle = "$type:$wpTitle"; |
136 | 136 | } |
137 | 137 | $wgOut->addHTML( |
138 | 138 | '<div class="recordadmin-menubar"><a href="' . $title->getLocalURL() . "/$type\">" . wfMsg( 'recordadmin-newsearch', $type ) . '</a>' |
— | — | @@ -141,7 +141,7 @@ |
142 | 142 | |
143 | 143 | # Get posted form values if any |
144 | 144 | $posted = array(); |
145 | | - foreach ( $_REQUEST as $k => $v ) if ( preg_match( '|^ra_(\\w+)|', $k, $m ) ) $posted[$m[1]] = is_array( $v ) ? join( "\n", $v ) : $v; |
| 145 | + foreach ( $_REQUEST as $k => $v ) if ( preg_match( "|^ra_(\\w+)|", $k, $m ) ) $posted[$m[1]] = is_array( $v ) ? join( "\n", $v ) : $v; |
146 | 146 | $this->filter = $posted; |
147 | 147 | |
148 | 148 | # Read in and prepare the form for this record type if one has been selected |
— | — | @@ -343,7 +343,7 @@ |
344 | 344 | # Loop through all records of this type adding only those that match the regex fields |
345 | 345 | $records = array(); |
346 | 346 | foreach ( self::getRecordsByType( $type ) as $t ) { |
347 | | - if ( empty( $wpTitle ) || eregi( $wpTitle, $t->getPrefixedText() ) ) { |
| 347 | + if ( empty( $wpTitle ) || preg_match( "|$wpTitle|i", $t->getPrefixedText() ) ) { |
348 | 348 | $a = new Article( $t ); |
349 | 349 | $text = $a->getContent(); |
350 | 350 | $match = true; |
— | — | @@ -386,7 +386,7 @@ |
387 | 387 | } |
388 | 388 | |
389 | 389 | # Sort the records according to "orderby" parameter |
390 | | - if ( $this->desc = eregi( ' +desc *$', $orderby ) ) $orderby = eregi_replace( ' +desc *$', '', $orderby ); |
| 390 | + if ( $this->desc = preg_match( "| +desc *$|", $orderby ) ) $orderby = preg_replace( "| +desc *$|", "", $orderby ); |
391 | 391 | $this->orderBy = $orderby; |
392 | 392 | usort( $records, array( $this, 'sortCallback' ) ); |
393 | 393 | |
— | — | @@ -429,9 +429,9 @@ |
430 | 430 | break; |
431 | 431 | |
432 | 432 | default: |
433 | | - $a = preg_replace( '|(\d\d)[-/](\d\d)[-/](\d\d\d\d)|', '$3/$2/$1', $a ); # hack for dd/mm/yyyy format - best to use yyyy-mm-dd |
434 | | - $b = preg_replace( '|(\d\d)[-/](\d\d)[-/](\d\d\d\d)|', '$3/$2/$1', $b ); |
435 | | - if ( !is_numeric( $b ) && ereg( '[0-9]{4}', $b ) && $tmp = strtotime( $b ) ) { |
| 433 | + $a = preg_replace( "|(\d\d)[-/](\d\d)[-/](\d\d\d\d)|", "$3/$2/$1", $a ); # hack for dd/mm/yyyy format - best to use yyyy-mm-dd |
| 434 | + $b = preg_replace( "|(\d\d)[-/](\d\d)[-/](\d\d\d\d)|", "$3/$2/$1", $b ); |
| 435 | + if ( !is_numeric( $b ) && preg_match( "|[0-9]{4}|", $b ) && $tmp = strtotime( $b ) ) { |
436 | 436 | $b = $tmp; |
437 | 437 | $a = strtotime( $a ); |
438 | 438 | } |
— | — | @@ -484,7 +484,7 @@ |
485 | 485 | 'modified' => "<th class='col3 col-modified'>" . wfMsg( 'recordadmin-modified' ) . "$br</th>" |
486 | 486 | ); |
487 | 487 | foreach ( array_keys( $this->types ) as $col ) { |
488 | | - $class = 'col' . preg_replace( '|\W|', '-', $col ); |
| 488 | + $class = 'col' . preg_replace( "|\W|", "-", $col ); |
489 | 489 | $th[$col] = "<th class='$class'>$col$br</th>"; |
490 | 490 | } |
491 | 491 | $tmp = array(); |
— | — | @@ -565,7 +565,7 @@ |
566 | 566 | foreach ( $cols as $col ) { |
567 | 567 | if ( !isset( $row[$col] ) ) { |
568 | 568 | $v = isset( $r[$col] ) ? $wgParser->parse( $r[$col], $wgTitle, $wgParser->mOptions, true, false )->getText() : ' '; |
569 | | - $class = 'col' . preg_replace( '|\W|', '-', $col ); |
| 569 | + $class = 'col' . preg_replace( "|\W|", "-", $col ); |
570 | 570 | $row[$col] = "<td class='$class'>$v</td>"; |
571 | 571 | } |
572 | 572 | $table .= "$row[$col]\n"; |
— | — | @@ -1057,7 +1057,7 @@ |
1058 | 1058 | elseif ( $k == 'groupby' ) $groupby = $v; |
1059 | 1059 | elseif ( $k == 'format' ) $format = $v; |
1060 | 1060 | elseif ( $k == 'cols' ) $cols = self::split( $v, ',' ); |
1061 | | - elseif ( $k == 'sortable' ) $sortable = eregi( '1|yes|true|on', $v ); |
| 1061 | + elseif ( $k == 'sortable' ) $sortable = preg_match( '/(1|yes|true|on)/i', $v ); |
1062 | 1062 | elseif ( $k == 'template' ) $template = $v; |
1063 | 1063 | elseif ( $k == 'count' ) $count = $v; |
1064 | 1064 | elseif ( $k == 'export' ) $export = $v; |