}
static function newFromLinksTo( &$title ) {
+ global $wgMaxSquidPurgeTitles;
wfProfileIn( __METHOD__ );
# Get a list of URLs linking to this page
'pl_from=page_id' ),
__METHOD__ );
$blurlArr = $title->getSquidURLs();
- if ( $dbr->numRows( $res ) <= $this->mMaxTitles ) {
- while ( $BL = $dbr->fetchObject ( $res ) )
- {
+ if ( $dbr->numRows( $res ) <= $wgMaxSquidPurgeTitles ) {
+ foreach ( $res as $BL ) {
$tobj = Title::makeTitle( $BL->page_namespace, $BL->page_title ) ;
$blurlArr[] = $tobj->getInternalURL();
}
}
- $dbr->freeResult ( $res ) ;
wfProfileOut( __METHOD__ );
return new SquidUpdate( $blurlArr );
* @return string
*/
static function expand( $url ) {
- global $wgInternalServer;
- if( $url != '' && $url{0} == '/' ) {
- return $wgInternalServer . $url;
+ global $wgInternalServer, $wgServer;
+ $server = $wgInternalServer !== false ? $wgInternalServer : $wgServer;
+ if( $url !== '' && $url[0] == '/' ) {
+ return $server . $url;
}
return $url;
}