Index: maintenance/updaters.inc
===================================================================
--- maintenance/updaters.inc	(.../REL1_9_0/phase3)	(revision 19621)
+++ maintenance/updaters.inc	(.../REL1_9_1/phase3)	(revision 19621)
@@ -35,7 +35,6 @@
 	array( 'langlinks',     'patch-langlinks.sql' ),
 	array( 'querycache_info', 'patch-querycacheinfo.sql' ),
 	array( 'filearchive',   'patch-filearchive.sql' ),
-	array( 'redirect',      'patch-redirect.sql' ),
 	array( 'querycachetwo',	'patch-querycachetwo.sql' ),
 );
 
@@ -43,7 +42,6 @@
 #           table            field             patch file (in maintenance/archives)
 	array( 'ipblocks',      'ipb_id',           'patch-ipblocks.sql' ),
 	array( 'ipblocks',      'ipb_expiry',       'patch-ipb_expiry.sql' ),
-	array( 'ipblocks',	'ipb_enable_autoblock', 'patch-ipb_optional_autoblock.sql' ),
 	array( 'recentchanges', 'rc_type',          'patch-rc_type.sql' ),
 	array( 'recentchanges', 'rc_ip',            'patch-rc_ip.sql' ),
 	array( 'recentchanges', 'rc_id',            'patch-rc_id.sql' ),
@@ -66,6 +64,7 @@
 	array( 'ipblocks',      'ipb_range_start',  'patch-ipb_range_start.sql' ),
 	array( 'site_stats',    'ss_images',        'patch-ss_images.sql' ),
 	array( 'ipblocks',      'ipb_anon_only',    'patch-ipb_anon_only.sql' ),
+	array( 'ipblocks',	'ipb_enable_autoblock', 'patch-ipb_optional_autoblock.sql' ),
 	array( 'user',          'user_newpass_time','patch-user_newpass_time.sql' ),
 	array( 'user',          'user_editcount',   'patch-user_editcount.sql' ),
 );
@@ -902,7 +901,9 @@
 	do_page_random_update(); flush();
 	
 	do_rc_indices_update(); flush();
-	
+
+	add_table( 'redirect', 'patch-redirect.sql' );
+
 	do_backlinking_indices_update(); flush();
 
 	echo "Deleting old default messages..."; flush();
Index: maintenance/Doxyfile
===================================================================
--- maintenance/Doxyfile	(.../REL1_9_0/phase3)	(revision 19621)
+++ maintenance/Doxyfile	(.../REL1_9_1/phase3)	(revision 19621)
@@ -133,7 +133,7 @@
 RECURSIVE              = YES
 EXCLUDE                = 
 EXCLUDE_SYMLINKS       = NO
-EXCLUDE_PATTERNS       = 
+EXCLUDE_PATTERNS       = LocalSettings.php AdminSettings.php
 EXAMPLE_PATH           = 
 EXAMPLE_PATTERNS       = *
 EXAMPLE_RECURSIVE      = NO
Index: skins/common/wikibits.js
===================================================================
--- skins/common/wikibits.js	(.../REL1_9_0/phase3)	(revision 19621)
+++ skins/common/wikibits.js	(.../REL1_9_1/phase3)	(revision 19621)
@@ -484,14 +484,12 @@
 	}
 
 	var pref;
-	if (is_safari || navigator.userAgent.toLowerCase().indexOf('mac') + 1
+	if (is_opera) {
+		pref = 'shift-esc-';
+	} else if (is_safari || navigator.userAgent.toLowerCase().indexOf('mac') + 1
 		|| navigator.userAgent.toLowerCase().indexOf('konqueror') + 1 ) {
 		pref = 'control-';
-	} else if (is_opera) {
-		pref = 'shift-esc-';
-	} else if (is_ff2_x11) {
-		pref = 'ctrl-shift-';
-	} else if (is_ff2_win) {
+	} else if (is_ff2_win || is_ff2_x11) {
 		pref = 'alt-shift-';
 	} else {
 		pref = 'alt-';
Index: includes/GlobalFunctions.php
===================================================================
--- includes/GlobalFunctions.php	(.../REL1_9_0/phase3)	(revision 19621)
+++ includes/GlobalFunctions.php	(.../REL1_9_1/phase3)	(revision 19621)
@@ -230,7 +230,7 @@
 			$forward .= ' anon';
 		$log = sprintf( "%s\t%04.3f\t%s\n",
 		  gmdate( 'YmdHis' ), $elapsed,
-		  urldecode( $_SERVER['REQUEST_URI'] . $forward ) );
+		  urldecode( $wgRequest->getRequestURL() . $forward ) );
 		if ( '' != $wgDebugLogFile && ( $wgRequest->getVal('action') != 'raw' || $wgDebugRawPage ) ) {
 			error_log( $log . $prof, 3, $wgDebugLogFile );
 		}
Index: includes/api/ApiQueryRevisions.php
===================================================================
--- includes/api/ApiQueryRevisions.php	(.../REL1_9_0/phase3)	(revision 19621)
+++ includes/api/ApiQueryRevisions.php	(.../REL1_9_1/phase3)	(revision 19621)
@@ -177,7 +177,7 @@
 		// Ensure that all revisions are shown as '<rev>' elements
 		$result = $this->getResult();
 		if ($result->getIsRawMode()) {
-			$data = $result->getData();
+			$data =& $result->getData();
 			foreach ($data['query']['pages'] as & $page) {
 				if (is_array($page) && array_key_exists('revisions', $page)) {
 					$result->setIndexedTagName($page['revisions'], 'rev');
Index: includes/api/ApiFormatBase.php
===================================================================
--- includes/api/ApiFormatBase.php	(.../REL1_9_0/phase3)	(revision 19621)
+++ includes/api/ApiFormatBase.php	(.../REL1_9_1/phase3)	(revision 19621)
@@ -81,7 +81,7 @@
 		if (is_null($mime))
 			return; // skip any initialization
 
-		header("Content-Type: $mime; charset=utf-8;");
+		header("Content-Type: $mime; charset=utf-8");
 
 		if ($isHtml) {
 ?>
Index: includes/WebRequest.php
===================================================================
--- includes/WebRequest.php	(.../REL1_9_0/phase3)	(revision 19621)
+++ includes/WebRequest.php	(.../REL1_9_1/phase3)	(revision 19621)
@@ -314,7 +314,20 @@
 	 * @return string
 	 */
 	function getRequestURL() {
-		$base = $_SERVER['REQUEST_URI'];
+		if( isset( $_SERVER['REQUEST_URI'] ) ) {
+			$base = $_SERVER['REQUEST_URI'];
+		} elseif( isset( $_SERVER['SCRIPT_NAME'] ) ) {
+			// Probably IIS; doesn't set REQUEST_URI
+			$base = $_SERVER['SCRIPT_NAME'];
+			if( isset( $_SERVER['QUERY_STRING'] ) && $_SERVER['QUERY_STRING'] != '' ) {
+				$base .= '?' . $_SERVER['QUERY_STRING'];
+			}
+		} else {
+			// This shouldn't happen!
+			throw new MWException( "Web server doesn't provide either " .
+				"REQUEST_URI or SCRIPT_NAME. Report details of your " .
+				"web server configuration to http://bugzilla.wikimedia.org/" );
+		}
 		if( $base{0} == '/' ) {
 			return $base;
 		} else {
Index: includes/Wiki.php
===================================================================
--- includes/Wiki.php	(.../REL1_9_0/phase3)	(revision 19621)
+++ includes/Wiki.php	(.../REL1_9_1/phase3)	(revision 19621)
@@ -118,7 +118,7 @@
 	 * Initialize the object to be known as $wgArticle for special cases
 	 */
 	function initializeSpecialCases ( &$title, &$output, $request ) {
-
+		global $wgRequest;
 		wfProfileIn( 'MediaWiki::initializeSpecialCases' );
 		
 		$search = $this->getVal('Search');
@@ -151,8 +151,7 @@
 			$targetUrl = $title->getFullURL();
 			// Redirect to canonical url, make it a 301 to allow caching
 			global $wgServer, $wgUsePathInfo;
-			if( isset( $_SERVER['REQUEST_URI'] ) &&
-				$targetUrl == $wgServer . $_SERVER['REQUEST_URI'] ) {
+			if( $targetUrl == $wgRequest->getFullRequestURL() ) {
 				$message = "Redirect loop detected!\n\n" .
 					"This means the wiki got confused about what page was " .
 					"requested; this sometimes happens when moving a wiki " .
Index: includes/Image.php
===================================================================
--- includes/Image.php	(.../REL1_9_0/phase3)	(revision 19621)
+++ includes/Image.php	(.../REL1_9_1/phase3)	(revision 19621)
@@ -2271,7 +2271,7 @@
 		# Check for files uploaded prior to DJVU support activation
 		# They have a '0' in their metadata field.
 		#
-		if ( $this->metadata == '0' ) {
+		if ( $this->metadata == '0' || $this->metadata == '' ) {
 			$deja = new DjVuImage( $this->imagePath );
 			$this->metadata = $deja->retrieveMetaData();
 			$this->purgeMetadataCache();
Index: includes/DefaultSettings.php
===================================================================
--- includes/DefaultSettings.php	(.../REL1_9_0/phase3)	(revision 19621)
+++ includes/DefaultSettings.php	(.../REL1_9_1/phase3)	(revision 19621)
@@ -32,7 +32,7 @@
 $wgConf = new SiteConfiguration;
 
 /** MediaWiki version number */
-$wgVersion			= '1.9.0';
+$wgVersion			= '1.9.1';
 
 /** Name of the site. It must be changed in LocalSettings.php */
 $wgSitename         = 'MediaWiki';
@@ -1096,7 +1096,7 @@
  * to ensure that client-side caches don't keep obsolete copies of global
  * styles.
  */
-$wgStyleVersion = '42';
+$wgStyleVersion = '42a';
 
 
 # Server-side caching:
@@ -2237,7 +2237,7 @@
 	MEDIATYPE_VIDEO,  //all plain video formats
 	"image/svg",  //svg (only needed if inline rendering of svg is not supported)
 	"application/pdf",  //PDF files
-	#"application/x-shockwafe-flash", //flash/shockwave movie
+	#"application/x-shockwave-flash", //flash/shockwave movie
 );
 
 /**
Index: includes/Skin.php
===================================================================
--- includes/Skin.php	(.../REL1_9_0/phase3)	(revision 19621)
+++ includes/Skin.php	(.../REL1_9_1/phase3)	(revision 19621)
@@ -783,13 +783,6 @@
 	function printableLink() {
 		global $wgOut, $wgFeedClasses, $wgRequest;
 
-		$baseurl = $_SERVER['REQUEST_URI'];
-		if( strpos( '?', $baseurl ) == false ) {
-			$baseurl .= '?';
-		} else {
-			$baseurl .= '&';
-		}
-		$baseurl = htmlspecialchars( $baseurl );
 		$printurl = $wgRequest->escapeAppendQuery( 'printable=yes' );
 
 		$s = "<a href=\"$printurl\">" . wfMsg( 'printableversion' ) . '</a>';
Index: includes/Exception.php
===================================================================
--- includes/Exception.php	(.../REL1_9_0/phase3)	(revision 19621)
+++ includes/Exception.php	(.../REL1_9_1/phase3)	(revision 19621)
@@ -54,10 +54,11 @@
 	}
 	
 	function getLogMessage() {
+		global $wgRequest;
 		$file = $this->getFile();
 		$line = $this->getLine();
 		$message = $this->getMessage();
-		return "{$_SERVER['REQUEST_URI']} Exception from line $line of $file: $message";
+		return $wgRequest->getRequestURL() . " Exception from line $line of $file: $message";
 	}
 	
 	function reportHTML() {
Index: includes/DjVuImage.php
===================================================================
--- includes/DjVuImage.php	(.../REL1_9_0/phase3)	(revision 19621)
+++ includes/DjVuImage.php	(.../REL1_9_1/phase3)	(revision 19621)
@@ -216,7 +216,8 @@
 	function retrieveMetaData() {
 		global $wgDjvuToXML;
 		if ( isset( $wgDjvuToXML ) ) {
-			$cmd = $wgDjvuToXML . ' --without-anno --without-text ' . $this->mFilename;
+			$cmd = $wgDjvuToXML . ' --without-anno --without-text ' .
+				wfEscapeShellArg( $this->mFilename );
 			$xml = wfShellExec( $cmd );
 		} else {
 			$xml = null;
Index: index.php
===================================================================
--- index.php	(.../REL1_9_0/phase3)	(revision 19621)
+++ index.php	(.../REL1_9_1/phase3)	(revision 19621)
@@ -14,6 +14,11 @@
 $action = $wgRequest->getVal( 'action', 'view' );
 $title = $wgRequest->getVal( 'title' );
 
+$wgTitle = $mediaWiki->checkInitialQueries( $title,$action,$wgOut, $wgRequest, $wgContLang );
+if ($wgTitle == NULL) {
+	unset( $wgTitle );
+}
+
 #
 # Send Ajax requests to the Ajax dispatcher.
 #
@@ -26,10 +31,6 @@
 	exit;
 }
 
-$wgTitle = $mediaWiki->checkInitialQueries( $title,$action,$wgOut, $wgRequest, $wgContLang );
-if ($wgTitle == NULL) {
-	unset( $wgTitle );
-}
 
 wfProfileOut( 'main-misc-setup' );
 
Index: languages/messages/MessagesHe.php
===================================================================
--- languages/messages/MessagesHe.php	(.../REL1_9_0/phase3)	(revision 19621)
+++ languages/messages/MessagesHe.php	(.../REL1_9_1/phase3)	(revision 19621)
@@ -344,7 +344,7 @@
 'privacy'           => 'מדיניות הפרטיות',
 'privacypage'       => '{{ns:project}}:מדיניות הפרטיות',
 'errorpagetitle'    => 'שגיאה',
-'returnto'          => 'חזרו לדף $1.',
+'returnto'          => 'חזרה לדף $1.',
 'tagline'           => 'מתוך {{SITENAME}}',
 'search'            => 'חיפוש',
 'searchbutton'      => 'חיפוש',
@@ -616,7 +616,7 @@
 'link_sample'     => 'קישור',
 'link_tip'        => 'קישור פנימי',
 'extlink_sample'  => 'http://www.example.com כותרת הקישור לתצוגה',
-'extlink_tip'     => 'קישור חיצוני (כולל קידומת http מלאה',
+'extlink_tip'     => 'קישור חיצוני (כולל קידומת http מלאה)',
 'headline_sample' => 'כותרת',
 'headline_tip'    => 'כותרת – דרגה 2',
 'math_sample'     => 'formula',
Index: languages/messages/MessagesAr.php
===================================================================
--- languages/messages/MessagesAr.php	(.../REL1_9_0/phase3)	(revision 19621)
+++ languages/messages/MessagesAr.php	(.../REL1_9_1/phase3)	(revision 19621)
@@ -406,7 +406,7 @@
 'noemailtext' => 'لم يحدد هذا المستخدم عنوان بريد إلكتروني صحيح،
 أو طلب عدم إستلام الرسائل من المستخدمين الآخرين.',
 'noemailtitle' => 'لا يوجد عنوان بريد إلكتروني',
-'noexactmatch' => 'لا يوجد صفحة بنفس العنوان، حاول البحث بشكل مفصل أكثر من خلال إستعمال صندوق البحث أدناه. بإمكانك أيضاً إنشاء [[:1|صفحة جديدة]] بالعنوان الذي طلبته.',
+'noexactmatch' => 'لا يوجد صفحة بنفس العنوان، حاول البحث بشكل مفصل أكثر من خلال إستعمال صندوق البحث أدناه. بإمكانك أيضاً إنشاء [[:$1|صفحة جديدة]] بالعنوان الذي طلبته.',
 'nohistory' => 'لا يوجد تاريخ للتغييرات لهذه الصفحة.',
 'nolinkshere' => 'لا يوجد صفحات تصل لهذه الصفحة.',
 'nolinkstoimage' => 'لا يوجد صفحات تصل لهذه الصورة.',
Index: RELEASE-NOTES
===================================================================
--- RELEASE-NOTES	(.../REL1_9_0/phase3)	(revision 19621)
+++ RELEASE-NOTES	(.../REL1_9_1/phase3)	(revision 19621)
@@ -3,6 +3,31 @@
 Security reminder: MediaWiki does not require PHP's register_globals
 setting since version 1.2.0. If you have it on, turn it *off* if you can.
 
+== MediaWiki 1.9.1 ==
+
+January 24, 2007
+
+This is a bug-fix update that fixes some installation and upgrade issues
+with the original 1.9.0 release.
+
+* (bug 3000) Fall back to SCRIPT_NAME plus QUERY_STRING when REQUEST_URI is
+  not available, as on IIS with PHP-CGI
+* Security fix for DjVu images. (Only affects servers where .djvu file
+  uploads are enabled and $wgDjvuToXML is set.)
+* (bug 8638) Fix update from 1.4 and earlier
+* (bug 8641) Fix order of updates to ipblocks table for updates from <=1.7
+* (bug 8673) Minor fix for web service API content-type header
+* Fix API revision list on PHP 5.2.1; bad reference assignment
+* Fixed up the AjaxSearch
+* Exclude settings files when generating documentation. That could
+  expose the database user and password to remote users.
+* ar: fix the 'create a new page' on search page when no exact match found
+* Correct tooltip accesskey hint for Opera on the Macintosh
+  (uses Shift-Esc-, not Ctrl-).
+* (bug 8719) Firefox release notes lie! Fix tooltips for Firefox 2 on x11;
+  accesskeys default settings appear to be same as Windows.
+
+
 == MediaWiki 1.9 ==
 
 January 10, 2007
