X-Git-Url: https://git.heureux-cyclage.org/w/index.php?a=blobdiff_plain;f=includes%2FLinker.php;h=5bb92308ff3af2284708d1b3d58c442adea10ffe;hb=99362c6add2e96333e6b428a7ec651c860c90fbd;hp=3e8a3c9f8c1922f4f401ff859af2408de1b32717;hpb=dfc977826c591f1087159c4794bab254b9cb34bf;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/Linker.php b/includes/Linker.php index 3e8a3c9f8c..5bb92308ff 100644 --- a/includes/Linker.php +++ b/includes/Linker.php @@ -199,7 +199,7 @@ class Linker { return "$html"; } - if( is_string( $query ) ) { + if ( is_string( $query ) ) { // some functions withing core using this still hand over query strings wfDeprecated( __METHOD__ . ' with parameter $query as string (should be array)', '1.20' ); $query = wfCgiToArray( $query ); @@ -644,7 +644,7 @@ class Linker { # If a thumbnail width has not been provided, it is set # to the default user option as specified in Language*.php if ( $fp['align'] == '' ) { - if( $parser instanceof Parser ) { + if ( $parser instanceof Parser ) { $fp['align'] = $parser->getTargetLanguage()->alignEnd(); } else { # backwards compatibility, remove with makeImageLink2() @@ -786,10 +786,18 @@ class Linker { $hp =& $handlerParams; $page = isset( $hp['page'] ) ? $hp['page'] : false; - if ( !isset( $fp['align'] ) ) $fp['align'] = 'right'; - if ( !isset( $fp['alt'] ) ) $fp['alt'] = ''; - if ( !isset( $fp['title'] ) ) $fp['title'] = ''; - if ( !isset( $fp['caption'] ) ) $fp['caption'] = ''; + if ( !isset( $fp['align'] ) ) { + $fp['align'] = 'right'; + } + if ( !isset( $fp['alt'] ) ) { + $fp['alt'] = ''; + } + if ( !isset( $fp['title'] ) ) { + $fp['title'] = ''; + } + if ( !isset( $fp['caption'] ) ) { + $fp['caption'] = ''; + } if ( empty( $hp['width'] ) ) { // Reduce width for upright images when parameter 'upright' is used @@ -970,12 +978,13 @@ class Linker { protected static function getUploadUrl( $destFile, $query = '' ) { global $wgUploadMissingFileUrl, $wgUploadNavigationUrl; $q = 'wpDestFile=' . $destFile->getPartialURL(); - if ( $query != '' ) + if ( $query != '' ) { $q .= '&' . $query; + } if ( $wgUploadMissingFileUrl ) { return wfAppendQuery( $wgUploadMissingFileUrl, $q ); - } elseif( $wgUploadNavigationUrl ) { + } elseif ( $wgUploadNavigationUrl ) { return wfAppendQuery( $wgUploadNavigationUrl, $q ); } else { $upload = SpecialPage::getTitleFor( 'Upload' ); @@ -1450,8 +1459,9 @@ class Linker { $trail = ""; } $linkRegexp = '/\[\[(.*?)\]\]' . preg_quote( $trail, '/' ) . '/'; - if ( isset( $match[1][0] ) && $match[1][0] == ':' ) + if ( isset( $match[1][0] ) && $match[1][0] == ':' ) { $match[1] = substr( $match[1], 1 ); + } list( $inside, $trail ) = self::splitTrail( $trail ); $linkText = $text; @@ -1678,10 +1688,10 @@ class Linker { $lang = wfGetLangObj( $lang ); $title = wfMessage( 'toc' )->inLanguage( $lang )->escaped(); - return '
'
+ return ' '
. ' ' . $title . " |