/**
* Holder of replacement pairs for wiki links
*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
* @file
+ * @ingroup Parser
*/
/**
/**
* Get a subset of the current LinkHolderArray which is sufficient to
* interpret the given text.
- * @return \LinkHolderArray
+ * @return LinkHolderArray
*/
function getSubArray( $text ) {
$sub = new LinkHolderArray( $this->parent );
* article length checks (for stub links) to be bundled into a single query.
*
* @param $nt Title
+ * @param $text String
+ * @param $query Array [optional]
+ * @param $trail String [optional]
+ * @param $prefix String [optional]
* @return string
*/
function makeHolder( $nt, $text = '', $query = array(), $trail = '', $prefix = '' ) {
foreach ( $entries as $index => $entry ) {
$pdbk = $entry['pdbk'];
// we only deal with new links (in its first query)
- if ( !isset( $colours[$pdbk] ) ) {
+ if ( !isset( $colours[$pdbk] ) || $colours[$pdbk] === 'new' ) {
$title = $entry['title'];
$titleText = $title->getText();
$titlesAttrs[] = array(
}
// Now do the conversion and explode string to text of titles
- $titlesAllVariants = $wgContLang->autoConvertToAllVariants( $titlesToBeConverted );
+ $titlesAllVariants = $wgContLang->autoConvertToAllVariants( rtrim( $titlesToBeConverted, "\0" ) );
$allVariantsName = array_keys( $titlesAllVariants );
foreach ( $titlesAllVariants as &$titlesVariant ) {
$titlesVariant = explode( "\0", $titlesVariant );
$entry =& $this->internals[$ns][$index];
$pdbk = $entry['pdbk'];
- if(!isset($colours[$pdbk])){
+ if ( !isset( $colours[$pdbk] ) || $colours[$pdbk] === 'new' ) {
// found link in some of the variants, replace the link holder data
$entry['title'] = $variantTitle;
$entry['pdbk'] = $varPdbk;