define( 'EXT_LINK_TEXT_CLASS', '[^\]\\x00-\\x1F\\x7F]' );
define( 'EXT_IMAGE_FNAME_CLASS', '[A-Za-z0-9_.,~%\\-+&;#*?!=()@\\x80-\\xFF]' );
define( 'EXT_IMAGE_EXTENSIONS', 'gif|png|jpg|jpeg' );
-define( 'EXT_LINK_BRACKETED', '/\[(('.URL_PROTOCOLS.'):'.EXT_LINK_URL_CLASS.'+) *('.EXT_LINK_TEXT_CLASS.'*?)\]/S' );
-define( 'EXT_IMAGE_REGEX',
+define( 'EXT_LINK_BRACKETED', '/\[(('.URL_PROTOCOLS.'):'.EXT_LINK_URL_CLASS.'+) *('.EXT_LINK_TEXT_CLASS.'*?)\]/S' );
+define( 'EXT_IMAGE_REGEX',
'/^('.HTTP_PROTOCOLS.':)'. # Protocol
'('.EXT_LINK_URL_CLASS.'+)\\/'. # Hostname and path
'('.EXT_IMAGE_FNAME_CLASS.'+)\\.((?i)'.EXT_IMAGE_EXTENSIONS.')$/S' # Filename
{
# Showing subcategories
$r .= '<h2>' . wfMsg( 'subcategories' ) . "</h2>\n";
-
+
$numchild = count( $children );
if($numchild == 1) {
$r .= wfMsg( 'subcategorycount1', 1 );
$r .= wfMsg( 'subcategorycount' , $numchild );
}
unset($numchild);
-
+
if ( count ( $children ) > 6 ) {
// divide list into three equal chunks
$r .= '</ul>';
}
} # END of if ( count($children) > 0 )
-
+
$r .= '<h2>' . wfMsg( 'category_header', $ti ) . "</h2>\n";
$numart = count( $articles );
$text = $this->doMagicLinks( $text );
$text = $this->replaceInternalLinks ( $text );
$text = $this->replaceInternalLinks ( $text );
-
+
$text = $this->unstrip( $text, $this->mStripState );
$text = $this->unstripNoWiki( $text, $this->mStripState );
$text .= $this->categoryMagic () ;
$this->categoryMagicDone = true ;
}
-
+
wfProfileOut( $fname );
return $text;
}
$protocol = $bits[$i++];
$text = $bits[$i++];
$trail = $bits[$i++];
-
+
# If the link text is an image URL, replace it with an <img> tag
# This happened by accident in the original parser, but some people used it extensively
$img = $this->maybeMakeImageLink( $text );
# No link text, e.g. [http://domain.tld/some.link]
if ( $text == '' ) {
# Autonumber if allowed
- if ( strpos( HTTP_PROTOCOLS, $protocol ) !== false ) {
+ if ( strpos( HTTP_PROTOCOLS, $protocol ) !== false ) {
$text = "[" . ++$this->mAutonumber . "]";
- } else {
+ } else {
# Otherwise just use the URL
- $text = htmlspecialchars( $url );
+ $text = htmlspecialchars( $url );
}
} else {
# Have link text, e.g. [http://domain.tld/some.link text]s
$trail = $m2[2];
}
}
-
+
$encUrl = htmlspecialchars( $url );
# Bit in parentheses showing the URL for the printable version
if( $url == $text || preg_match( "!$protocol://" . preg_quote( $text, "/" ) . "/?$!", $url ) ) {
$paren = '';
} else {
# Expand the URL for printable version
- $paren = "<span class='urlexpansion'> (<i>" . htmlspecialchars ( $encUrl ) . "</i>)</span>";
+ if ( ! $sk->suppressUrlExpansion() ) {
+ $paren = "<span class='urlexpansion'> (<i>" . htmlspecialchars ( $encUrl ) . "</i>)</span>";
+ } else {
+ $paren = '';
+ }
}
# Process the trail (i.e. everything after this link up until start of the next link),
$trail = $this->replaceFreeExternalLinks( $trail );
$la = $sk->getExternalLinkAttributes( $url, $text );
-
+
# Use the encoded URL
# This means that users can paste URLs directly into the text
# Funny characters like ö aren't valid in URLs anyway
# Found some characters after the protocol that look promising
$url = $protocol . $m[1];
$trail = $m[2];
-
+
# Move trailing punctuation to $trail
$sep = ',;\.:!?';
# If there is no left bracket, then consider right brackets fair game too
}
return $s;
}
-
+
function maybeMakeImageLink( $url ) {
$sk =& $this->mOptions->getSkin();
$text = false;
# Language class has internationalized names
#
/* private */ $wgValidSkinNames = array(
- 'standard' => 'Standard',
- 'nostalgia' => 'Nostalgia',
- 'cologneblue' => 'CologneBlue'
+ 'standard' => 'Standard',
+ 'nostalgia' => 'Nostalgia',
+ 'cologneblue' => 'CologneBlue'
);
if( $wgUsePHPTal ) {
- #$wgValidSkinNames[] = 'PHPTal';
- #$wgValidSkinNames['davinci'] = 'DaVinci';
- #$wgValidSkinNames['mono'] = 'Mono';
- $wgValidSkinNames['monobook'] = 'MonoBook';
- $wgValidSkinNames['myskin'] = 'MySkin';
- #$wgValidSkinNames['monobookminimal'] = 'MonoBookMinimal';
+ #$wgValidSkinNames[] = 'PHPTal';
+ #$wgValidSkinNames['davinci'] = 'DaVinci';
+ #$wgValidSkinNames['mono'] = 'Mono';
+ $wgValidSkinNames['monobook'] = 'MonoBook';
+ $wgValidSkinNames['myskin'] = 'MySkin';
+ #$wgValidSkinNames['monobookminimal'] = 'MonoBookMinimal';
+ $wgValidSkinNames['chick'] = 'Chick';
}
require_once( 'RecentChange.php' );
return $toolbar;
}
+ /* public */ function suppressUrlExpansion() {
+ return false;
+ }
}
}