cvs: pear /Text_Wiki/Text/Wiki/Parse/Mediawiki Wikilink.php

From: Date: Sat, 25 Feb 2006 04:19:55 +0000
Subject: cvs: pear /Text_Wiki/Text/Wiki/Parse/Mediawiki Wikilink.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-38576@lists.php.net to get a copy of this message
toggg Sat Feb 25 04:19:55 2006 UTC Modified files: /pear/Text_Wiki/Text/Wiki/Parse/Mediawiki Wikilink.php Log: Correct the prefixes handling http://cvs.php.net/viewcvs.cgi/pear/Text_Wiki/Text/Wiki/Parse/Mediawiki/Wikilink.php?r1=1.3&r2=1.4&diff_format=u Index: pear/Text_Wiki/Text/Wiki/Parse/Mediawiki/Wikilink.php diff -u pear/Text_Wiki/Text/Wiki/Parse/Mediawiki/Wikilink.php:1.3 pear/Text_Wiki/Text/Wiki/Parse/Mediawiki/Wikilink.php:1.4 --- pear/Text_Wiki/Text/Wiki/Parse/Mediawiki/Wikilink.php:1.3 Fri Feb 24 12:52:00 2006 +++ pear/Text_Wiki/Text/Wiki/Parse/Mediawiki/Wikilink.php Sat Feb 25 04:19:55 2006 @@ -18,7 +18,7 @@ * @author Paul M. Jones <pmjones@php.net> * @copyright 2005 bertrand Gugger * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1 - * @version CVS: $Id: Wikilink.php,v 1.3 2006/02/24 12:52:00 toggg Exp $ + * @version CVS: $Id: Wikilink.php,v 1.4 2006/02/25 04:19:55 toggg Exp $ * @link http://pear.php.net/package/Text_Wiki */ @@ -155,13 +155,15 @@ // Prefix ? if (!empty($matches[2])) { $prefix = explode(':', substr($matches[2], 0, -1)); + $count = count($prefix); $i = -1; // Autolink if (in_array(trim($prefix[0]), $this->conf['project'])) { $auto = trim($prefix[0]); + unset($prefix[0]); $i = 0; } - while (++$i < count($prefix)) { + while (++$i < $count) { $prefix[$i] = trim($prefix[$i]); // interlangage if (!$interlang && @@ -183,7 +185,9 @@ } break; } - $matches[3] = implode(':', $prefix) . $matches[3]; + if ($prefix) { + $matches[3] = implode(':', $prefix) . ':' . $matches[3]; + } } $text = empty($matches[5]) ? $matches[3] : $matches[5]; $matches[3] = trim($matches[3]); @@ -237,7 +241,7 @@ * @param array &$matches The array of matches from parse(). * @return string token to be used as replacement */ - function interwiki($name, $text, $interlang, $colon) + function interwiki($interwiki, $page, $text, $interlang, $colon) { return ''; }

« previous php.pear.cvs (#38576) next »