<?php
+
#apd_set_pprof_trace();
# Main wiki script; see design.doc
#
$wgTitle = Title::newFromText( wfMsgForContent( 'badtitle' ) );
$wgOut->errorpage( 'badtitle', 'badtitletext' );
} else if ( $wgTitle->getInterwiki() != '' ) {
+ if( $wgUseLatin1 ) {
+ # Conversion from UTF-8 may truncate or corrupt non-Latin links.
+ # Grab a fresh copy without doing the automated conversion checks.
+ $interwiki = Title::newFromUrl( $_REQUEST['title'] );
+ if( !is_null( $interwiki ) ) $wgTitle = $interwiki;
+ }
$url = $wgTitle->getFullURL();
# Check for a redirect loop
if ( !preg_match( '/^' . preg_quote( $wgServer, '/' ) . '/', $url ) && $wgTitle->isLocal() ) {
/* redirect to canonical url, make it a 301 to allow caching */
$wgOut->setSquidMaxage( 1200 );
$wgOut->redirect( $wgTitle->getFullURL(), '301');
-} else if ( Namespace::getSpecial() == $wgTitle->getNamespace() ) {
+} else if ( NS_SPECIAL == $wgTitle->getNamespace() ) {
# actions that need to be made when we have a special pages
require_once( 'includes/SpecialPage.php' );
SpecialPage::executePath( $wgTitle );
} else {
- if ( Namespace::getMedia() == $wgTitle->getNamespace() ) {
+ if ( NS_MEDIA == $wgTitle->getNamespace() ) {
$wgTitle = Title::makeTitle( NS_IMAGE, $wgTitle->getDBkey() );
}
$wgLoadBalancer->commitAll();
$wgOut->output();
+
+foreach ( $wgPostCommitUpdateList as $up ) {
+ $up->doUpdate();
+}
+
wfProfileOut( 'main-cleanup' );
logProfilingData();