$a = array_slice ( $a , 0 , 10 ) ; # 10 keywords max
$a = implode ( "," , $a ) ;
$strip = array(
- "/<.*?>/" => '',
+ "/<.*?" . ">/" => '',
"/[_]/" => ' '
);
$a = htmlspecialchars(preg_replace(array_keys($strip), array_values($strip),$a ));
if ( count( $this->mKeywords ) > 0 ) {
$strip = array(
- "/<.*?>/" => '',
+ "/<.*?" . ">/" => '',
"/[_]/" => ' '
);
$ret .= "<meta name=\"keywords\" content=\"" .
$colours = array();
# Get placeholders from body
+ wfProfileIn( "$fname-match" );
preg_match_all( "/<!--LINK (.*?) (.*?) (.*?) (.*?)-->/", $this->mBodytext, $tmpLinks );
+ wfProfileOut( "$fname-match" );
if ( !empty( $tmpLinks[0] ) ) {
+ wfProfileIn( "$fname-check" );
$dbr =& wfGetDB( DB_SLAVE );
$cur = $dbr->tableName( 'cur' );
$sk = $wgUser->getSkin();
}
}
}
+ wfProfileOut( "$fname-check" );
# Construct search and replace arrays
+ wfProfileIn( "$fname-construct" );
$search = $replace = array();
foreach ( $namespaces as $key => $ns ) {
$pdbk = $pdbks[$key];
$replace[] = $sk->makeStubLinkObj( $title, $texts[$key], $queries[$key] );
}
}
+ wfProfileOut( "$fname-construct" );
# Do the thing
+ wfProfileIn( "$fname-replace" );
$this->mBodytext = str_replace( $search, $replace, $this->mBodytext );
+ wfProfileOut( "$fname-replace" );
}
wfProfileOut( $fname );
return $colours;