r47870 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r47869‎ | r47870 | r47871 >
Date:17:56, 27 February 2009
Author:aaron
Status:ok
Tags:
Comment:
Removed strval calls from magicLinkCallback(); items already comes in as one
Modified paths:
  • /trunk/phase3/includes/parser/Parser.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/parser/Parser.php
@@ -933,16 +933,16 @@
934934 }
935935
936936 function magicLinkCallback( $m ) {
937 - if ( isset( $m[1] ) && strval( $m[1] ) !== '' ) {
 937+ if ( isset( $m[1] ) && $m[1] !== '' ) {
938938 # Skip anchor
939939 return $m[0];
940 - } elseif ( isset( $m[2] ) && strval( $m[2] ) !== '' ) {
 940+ } elseif ( isset( $m[2] ) && $m[2] !== '' ) {
941941 # Skip HTML element
942942 return $m[0];
943 - } elseif ( isset( $m[3] ) && strval( $m[3] ) !== '' ) {
 943+ } elseif ( isset( $m[3] ) && $m[3] !== '' ) {
944944 # Free external link
945945 return $this->makeFreeExternalLink( $m[0] );
946 - } elseif ( isset( $m[4] ) && strval( $m[4] ) !== '' ) {
 946+ } elseif ( isset( $m[4] ) && $m[4] !== '' ) {
947947 # RFC or PMID
948948 if ( substr( $m[0], 0, 3 ) === 'RFC' ) {
949949 $keyword = 'RFC';
@@ -960,7 +960,7 @@
961961 $sk = $this->mOptions->getSkin();
962962 $la = $sk->getExternalLinkAttributes( $url, $keyword.$id );
963963 return "<a href=\"{$url}\"{$la}>{$keyword} {$id}</a>";
964 - } elseif ( isset( $m[5] ) && strval( $m[5] ) !== '' ) {
 964+ } elseif ( isset( $m[5] ) && $m[5] !== '' ) {
965965 # ISBN
966966 $isbn = $m[5];
967967 $num = strtr( $isbn, array(

Status & tagging log