ClausVB
Administrator
mwCMS supporter
    
Posts: 73

|
 |
« Reply #1 on: Tuesday, September 30, 2008 (16:00) » |
|
This is a bug. Fixed in the next release.
You can change your "include/class_parser.php":
<?php (...)
// Images if (preg_match( '!src="(.*?)/thumb(.*?)/([0-9]{2}|[0-9]{3})px(.*?)"!', $oneLine, $src) or preg_match('/class="image"/', $oneLine) ) { if (count($src) > 1) // Is this image a thumbnail? { // Find all thumbnails in this line $count_thumbnails = substr_count($oneLine, '<a href');
if ($count_thumbnails > 1) // More than one thumbnail in this line? { $exploded_line = explode('<a href', $oneLine);
foreach ($exploded_line as $string) { preg_match( '!src="(.*?)/thumb(.*?)/([0-9]{2}|[0-9]{3})px(.*?)"!', $string, $thumbSource );
if (preg_match('!^="/index.php/Bild:!', $string)) { // original: ="/index.php/Bild: ... // replaced by: <a href="http://your.domain.net/images/c/c2/pic1.jpg ... $newString .= '<a href' . preg_replace( '!/index.php/Bild:[\w-_]+\.([a-z]{3}|[a-z]{4})!', 'http://' . SERVER . $thumbSource[1] . $thumbSource[2], $string ); } else { $newString .= $string; } }
$modifiedLine = $newString; } else // Just one thumbnail in this line { $modifiedLine = str_replace('<img', '<a href="http://' . SERVER . $src[1] . $src[2] . '"><img', $modifiedLine); } } else { // Delete hyperlink to image (it's not a thumbnail), but store TITLE attribute $modifiedLine = preg_replace( '!<a href="(.+)" class="image" title="(.+)"><img !', '<!-- mwCMS: Delete hyperlink to image (no thumbnail) --><img title="$2" ', $modifiedLine );
$modifiedLine = str_replace('/></a>', '/>', $modifiedLine); }
// MediaWiki in a subdomain, e.g. "http://mediawiki.your-domain.tld" $modifiedLine = str_replace('src="', 'src="http://' . SERVER, $modifiedLine);
/** * MediaWiki in a subdirectory, e.g. "http://localhost/mediawiki", then * delete the line above or use "//". **/ }
(...) ?> WATCH OUT: This code is within the method called "ParsingEveryLine".
Thanks for reporting this bug.
Regards, Claus
|