Mass-fixed all AJAX functions to also check the HTTP status code before parsing the response
authorDan
Sun, 10 Feb 2008 19:35:06 -0500
changeset 407 35d94240a197
parent 406 7468a663315f
child 408 7ecbe721217c
Mass-fixed all AJAX functions to also check the HTTP status code before parsing the response
includes/clientside/sbedit.js
includes/clientside/static/acl.js
includes/clientside/static/ajax.js
includes/clientside/static/autocomplete.js
includes/clientside/static/autofill.js
includes/clientside/static/comments.js
includes/clientside/static/editor.js
includes/clientside/static/misc.js
includes/render.php
includes/wikiformat.php
install/includes/stages/database_mysql.php
install/includes/stages/database_postgresql.php
install/includes/stages/website.php
plugins/SpecialAdmin.php
plugins/SpecialUserFuncs.php
--- a/includes/clientside/sbedit.js	Fri Feb 08 23:20:20 2008 -0500
+++ b/includes/clientside/sbedit.js	Sun Feb 10 19:35:06 2008 -0500
@@ -4,7 +4,7 @@
   disenable_currentBlock = document.getElementById('disabled_'+id);
   ajaxGet(makeUrlNS('Special', 'EditSidebar', 'action=disenable&ajax=true&noheaders&id='+id), function()
     {
-      if(ajax.readyState == 4)
+      if ( ajax.readyState == 4 && ajax.status == 200 )
       {
         if(ajax.responseText == 'GOOD')
         {
@@ -31,7 +31,7 @@
   delete_currentBlock = { 0 : id, 1 : oElm };
   ajaxGet(makeUrlNS('Special', 'EditSidebar', 'action=delete&ajax=true&noheaders&id='+id), function()
     {
-      if(ajax.readyState == 4)
+      if ( ajax.readyState == 4 && ajax.status == 200 )
       {
         if(ajax.responseText == 'GOOD')
         {
@@ -53,7 +53,7 @@
   blockEdit_current = { 0 : id, 1 : oElm };
   ajaxGet(makeUrlNS('Special', 'EditSidebar', 'action=getsource&noheaders&id='+id), function()
     {
-      if(ajax.readyState == 4)
+      if ( ajax.readyState == 4 && ajax.status == 200 )
       {
         id = blockEdit_current[0];
         oElm = blockEdit_current[1];
@@ -100,7 +100,7 @@
   blockSave_current = { 0 : id, 1 : oElm };
   ajaxPost(makeUrlNS('Special', 'EditSidebar', 'noheaders&action=save&id='+id), 'content='+taContent, function()
     {
-      if(ajax.readyState == 4)
+      if ( ajax.readyState == 4 && ajax.status == 200 )
       {
         id   = blockSave_current[0];
         oElm = blockSave_current[1];
@@ -172,7 +172,7 @@
   newname = ajaxEscape(newname);
   ajaxPost(makeUrlNS('Special', 'EditSidebar', 'ajax&noheaders&action=rename&id='+id), 'newname=' +newname, function()
     {
-      if ( ajax.readyState == 4 )
+      if ( ajax.readyState == 4 && ajax.status == 200 )
       {
         parent.removeChild(img);
         if ( ajax.responseText != 'GOOD' )
--- a/includes/clientside/static/acl.js	Fri Feb 08 23:20:20 2008 -0500
+++ b/includes/clientside/static/acl.js	Sun Feb 10 19:35:06 2008 -0500
@@ -25,7 +25,7 @@
   params = toJSONString(params);
   params = ajaxEscape(params);
   ajaxPost(stdAjaxPrefix+'&_mode=acljson', 'acl_params='+params, function() {
-      if(ajax.readyState == 4)
+      if ( ajax.readyState == 4 && ajax.status == 200 )
       {
         var response = String(ajax.responseText + '');
         if ( response.substr(0, 1) != '{' )
@@ -66,7 +66,7 @@
   params = toJSONString(params);
   params = ajaxEscape(params);
   ajaxPost(stdAjaxPrefix+'&_mode=acljson', 'acl_params='+params, function() {
-      if(ajax.readyState == 4)
+      if ( ajax.readyState == 4 && ajax.status == 200 )
       {
         document.getElementById(aclManagerID+'_main').innerHTML = '';
         document.getElementById(aclManagerID + '_back').style.display = 'none';
@@ -316,7 +316,7 @@
   params = toJSONString(params);
   params = ajaxEscape(params);
   ajaxPost(stdAjaxPrefix+'&_mode=acljson', 'acl_params='+params, function() {
-      if(ajax.readyState == 4)
+      if ( ajax.readyState == 4 && ajax.status == 200 )
       {
         var response = String(ajax.responseText + '');
         if ( response.substr(0, 1) != '{' )
@@ -459,7 +459,7 @@
           params = toJSONString(params);
           params = ajaxEscape(params);
           ajaxPost(stdAjaxPrefix+'&_mode=acljson', 'acl_params='+params, function() {
-              if(ajax.readyState == 4)
+              if ( ajax.readyState == 4 && ajax.status == 200 )
               {
                 document.getElementById(aclManagerID+'_main').innerHTML = '';
                 document.getElementById(aclManagerID + '_back').style.display = 'none';
--- a/includes/clientside/static/ajax.js	Fri Feb 08 23:20:20 2008 -0500
+++ b/includes/clientside/static/ajax.js	Sun Feb 10 19:35:06 2008 -0500
@@ -185,7 +185,7 @@
   enableUnload();
   setAjaxLoading();
   ajaxGet(stdAjaxPrefix+'&_mode=getpage&noheaders', function() {
-    if(ajax.readyState == 4) {
+    if ( ajax.readyState == 4 && ajax.status == 200 ) {
       unsetAjaxLoading();
       document.getElementById('ajaxEditContainer').innerHTML = ajax.responseText;
       selectButtonMajor('article');
@@ -212,7 +212,7 @@
   document.getElementById('protbtn_2').style.textDecoration = 'none';
   document.getElementById('protbtn_'+l).style.textDecoration = 'underline';
   ajaxPost(stdAjaxPrefix+'&_mode=protect', 'reason='+ajaxEscape(r)+'&level='+l, function() {
-    if(ajax.readyState == 4) {
+    if ( ajax.readyState == 4 && ajax.status == 200 ) {
       unsetAjaxLoading();
       if(ajax.responseText != 'good')
         alert(ajax.responseText);
@@ -229,7 +229,7 @@
   if(!r || r=='') return;
   setAjaxLoading();
   ajaxPost(stdAjaxPrefix+'&_mode=rename', 'newtitle='+ajaxEscape(r), function() {
-    if(ajax.readyState == 4) {
+    if ( ajax.readyState == 4 && ajax.status == 200 ) {
       unsetAjaxLoading();
       alert(ajax.responseText);
     }
@@ -243,7 +243,7 @@
     return true;
   setAjaxLoading();
   ajaxPost(ENANO_SPECIAL_CREATEPAGE, ENANO_CREATEPAGE_PARAMS, function() {
-    if(ajax.readyState == 4) {
+    if ( ajax.readyState == 4 && ajax.status == 200 ) {
       unsetAjaxLoading();
       window.location.reload();
     }
@@ -267,7 +267,7 @@
   }
   setAjaxLoading();
   ajaxPost(stdAjaxPrefix+'&_mode=deletepage', 'reason=' + ajaxEscape(reason), function() {
-    if(ajax.readyState == 4) {
+    if ( ajax.readyState == 4 && ajax.status == 200 ) {
       unsetAjaxLoading();
       alert(ajax.responseText);
       window.location.reload();                                                                           
@@ -284,7 +284,7 @@
   if(!c) return;
   setAjaxLoading();
   ajaxGet(stdAjaxPrefix+'&_mode=delvote', function() {
-    if(ajax.readyState == 4) {
+    if ( ajax.readyState == 4 && ajax.status == 200 ) {
       unsetAjaxLoading();
       alert(ajax.responseText);
     }
@@ -300,7 +300,7 @@
   if(!c) return;
   setAjaxLoading();
   ajaxGet(stdAjaxPrefix+'&_mode=resetdelvotes', function() {
-    if(ajax.readyState == 4) {
+    if ( ajax.readyState == 4 && ajax.status == 200 ) {
       unsetAjaxLoading();
       alert(ajax.responseText);
       item = document.getElementById('mdgDeleteVoteNoticeBox');
@@ -323,7 +323,7 @@
   document.getElementById('wikibtn_2').style.textDecoration = 'none';
   document.getElementById('wikibtn_'+val).style.textDecoration = 'underline';
   ajaxGet(stdAjaxPrefix+'&_mode=setwikimode&mode='+val, function() {
-    if(ajax.readyState == 4) {
+    if ( ajax.readyState == 4 && ajax.status == 200 ) {
       unsetAjaxLoading();
       if(ajax.responseText!='GOOD')
       {
@@ -344,7 +344,7 @@
     return true;
   setAjaxLoading();
   ajaxGet(stdAjaxPrefix+'&_mode=catedit', function() {
-    if(ajax.readyState == 4) {
+    if ( ajax.readyState == 4 && ajax.status == 200 ) {
       unsetAjaxLoading();
       edit_open = false;
       eval(ajax.responseText);
@@ -372,7 +372,7 @@
   setAjaxLoading();
   query = query.substring(1, query.length);
   ajaxPost(stdAjaxPrefix+'&_mode=catsave', query, function() {
-    if(ajax.readyState == 4) {
+    if ( ajax.readyState == 4 && ajax.status == 200 ) {
       unsetAjaxLoading();
       edit_open = false;
       if(ajax.responseText != 'GOOD') alert(ajax.responseText);
@@ -390,7 +390,7 @@
     return true;
   setAjaxLoading();
   ajaxGet(stdAjaxPrefix+'&_mode=histlist', function() {
-    if(ajax.readyState == 4) {
+    if ( ajax.readyState == 4 && ajax.status == 200 ) {
       unsetAjaxLoading();
       edit_open = false;
       selectButtonMajor('article');
@@ -408,7 +408,7 @@
   if(!tit) tit=title;
   setAjaxLoading();
   ajaxGet(append_sid(scriptPath+'/ajax.php?title='+tit+'&_mode=getpage&oldid='+oldid), function() {
-    if(ajax.readyState == 4) {
+    if ( ajax.readyState == 4 && ajax.status == 200 ) {
       unsetAjaxLoading();
       edit_open = false;
       document.getElementById('ajaxEditContainer').innerHTML = ajax.responseText;
@@ -422,7 +422,7 @@
     return true;
   setAjaxLoading();
   ajaxGet(stdAjaxPrefix+'&_mode=rollback&id='+id, function() {
-    if(ajax.readyState == 4) {
+    if ( ajax.readyState == 4 && ajax.status == 200 ) {
       unsetAjaxLoading();
       alert(ajax.responseText);
     }
@@ -440,7 +440,7 @@
   if(!c) return;
   setAjaxLoading();
   ajaxGet(stdAjaxPrefix+'&_mode=flushlogs', function() {
-    if(ajax.readyState == 4) {
+    if ( ajax.readyState == 4 && ajax.status == 200 ) {
       unsetAjaxLoading();
       alert(ajax.responseText);
       window.location.reload();
@@ -524,7 +524,7 @@
   setAjaxLoading();
   ajaxGet(stdAjaxPrefix+'&_mode=pagediff&diff1='+id1+'&diff2='+id2, function()
     {
-      if(ajax.readyState==4)
+      if ( ajax.readyState == 4 && ajax.status == 200 )
       {
         unsetAjaxLoading();
         document.getElementById('ajaxEditContainer').innerHTML = ajax.responseText;
@@ -565,7 +565,7 @@
     return null;
   }
   ajaxGet(stdAjaxPrefix + '&_mode=getstyles&id=' + id, function() {
-      if ( ajax.readyState == 4 )
+      if ( ajax.readyState == 4 && ajax.status == 200 )
       {
         // IE doesn't like substr() on ajax.responseText
         var response = String(ajax.responseText + ' ');
@@ -640,7 +640,7 @@
   
   ajaxPost(stdAjaxPrefix + '&_mode=change_theme', 'theme_id=' + ajaxEscape(theme_id) + '&style_id=' + ajaxEscape(style_id), function()
     {
-      if ( ajax.readyState == 4 )
+      if ( ajax.readyState == 4 && ajax.status == 200 )
       {
         if ( ajax.responseText == 'GOOD' )
         {
@@ -696,7 +696,7 @@
 function ajaxGetStyles(id) {
   setAjaxLoading();
   ajaxGet(stdAjaxPrefix+'&_mode=getstyles&id='+id, function() {
-    if(ajax.readyState == 4) {
+    if ( ajax.readyState == 4 && ajax.status == 200 ) {
       unsetAjaxLoading();
       eval(ajax.responseText);
       html = '<h3>And a style...</h3><select id="mdgStyleID" name="style">';
@@ -739,7 +739,7 @@
   ajaxPost(stdAjaxPrefix+'&_mode=setpass', 'password='+pass, function()
     {
       unsetAjaxLoading();
-      if(ajax.readyState==4)
+      if ( ajax.readyState == 4 && ajax.status == 200 )
       {
         alert(ajax.responseText);
       }
@@ -863,7 +863,7 @@
   $killdiv.object.innerHTML = '<img alt="Loading..." src="' + scriptPath + '/images/loading-big.gif" /><br />Making request...';
   var url = makeUrlNS('Admin', 'Home', 'src=ajax');
   ajaxPost(url, 'act=kill_php', function() {
-      if ( ajax.readyState == 4 )
+      if ( ajax.readyState == 4 && ajax.status == 200 )
       {
         if ( ajax.responseText == '1' )
         {
@@ -895,7 +895,7 @@
   setAjaxLoading();
   ajaxGet(stdAjaxPrefix + '&_mode=get_tags', function()
     {
-      if ( ajax.readyState == 4 )
+      if ( ajax.readyState == 4 && ajax.status == 200 )
       {
         unsetAjaxLoading();
         var resptext = String(ajax.responseText + ' ');
@@ -993,7 +993,7 @@
   setAjaxLoading();
   ajaxPost(stdAjaxPrefix + '&_mode=addtag', 'tag=' + tag, function()
     {
-      if ( ajax.readyState == 4 )
+      if ( ajax.readyState == 4 && ajax.status == 200 )
       {
         unsetAjaxLoading();
         var nukeme = addtag_nukeme;
@@ -1065,7 +1065,7 @@
     
   ajaxPost(stdAjaxPrefix + '&_mode=deltag', 'tag_id=' + String(tag_id), function()
     {
-      if ( ajax.readyState == 4 )
+      if ( ajax.readyState == 4 && ajax.status == 200 )
       {
         if ( ajax.responseText == 'success' )
         {
@@ -1205,7 +1205,7 @@
   target.appendChild(img);
   ajaxGet(makeUrlNS('Admin', 'Home/updates.xml'), function()
     {
-      if ( ajax.readyState == 4 )
+      if ( ajax.readyState == 4 && ajax.status == 200 )
       {
         var releases = new Array();
         var update_available = false;
--- a/includes/clientside/static/autocomplete.js	Fri Feb 08 23:20:20 2008 -0500
+++ b/includes/clientside/static/autocomplete.js	Sun Feb 10 19:35:06 2008 -0500
@@ -137,7 +137,7 @@
   val = escape(o.value).replace('+', '%2B');
   ajaxGet(stdAjaxPrefix+'&_mode=fillusername&name='+val, function()
     {
-      if(ajax.readyState==4)
+      if ( ajax.readyState == 4 && ajax.status == 200 )
       {
         // Determine the appropriate left/top positions, then create a div to use for the drop-down list
         // The trick here is to be able to make the div dynamically destroy itself depending on how far the user's mouse is from it
@@ -224,7 +224,7 @@
   ajaxGet(stdAjaxPrefix+'&_mode=fillpagename&name='+val, function()
     {
       if(!ajax) return;
-      if(ajax.readyState==4)
+      if ( ajax.readyState == 4 && ajax.status == 200 )
       {
         // Determine the appropriate left/top positions, then create a div to use for the drop-down list
         // The trick here is to be able to make the div dynamically destroy itself depending on how far the user's mouse is from it
--- a/includes/clientside/static/autofill.js	Fri Feb 08 23:20:20 2008 -0500
+++ b/includes/clientside/static/autofill.js	Sun Feb 10 19:35:06 2008 -0500
@@ -182,7 +182,7 @@
     af_current = this;
     var processResponse = function()
     {
-      if ( ajax.readyState == 4 )
+      if ( ajax.readyState == 4 && ajax.status == 200 )
       {
         var afobj = af_current;
         af_current = false;
--- a/includes/clientside/static/comments.js	Fri Feb 08 23:20:20 2008 -0500
+++ b/includes/clientside/static/comments.js	Sun Feb 10 19:35:06 2008 -0500
@@ -19,7 +19,7 @@
     parms.have_template = true;
   parms = ajaxEscape(toJSONString(parms));
   ajaxPost(stdAjaxPrefix+'&_mode=comments', 'data=' + parms, function() {
-    if(ajax.readyState == 4) {
+    if ( ajax.readyState == 4 && ajax.status == 200 ) {
       unsetAjaxLoading();
       selectButtonMajor('discussion');
       unselectAllButtonsMinor();
--- a/includes/clientside/static/editor.js	Fri Feb 08 23:20:20 2008 -0500
+++ b/includes/clientside/static/editor.js	Sun Feb 10 19:35:06 2008 -0500
@@ -54,7 +54,7 @@
   setAjaxLoading();
   ajaxGet(stdAjaxPrefix + '&_mode=getsource', function()
     {
-      if ( ajax.readyState == 4 )
+      if ( ajax.readyState == 4 && ajax.status == 200 )
       {
         unsetAjaxLoading();
         
@@ -443,7 +443,7 @@
   json_packet = ajaxEscape(toJSONString(json_packet));
   ajaxPost(stdAjaxPrefix + '&_mode=savepage_json', 'r=' + json_packet, function()
     {
-      if ( ajax.readyState == 4 )
+      if ( ajax.readyState == 4 && ajax.status == 200 )
       {
         ajaxUnSetEditorLoading();
         var response = String(ajax.responseText + '');
@@ -499,7 +499,7 @@
           changeOpac(0, 'ajaxEditContainer');
           ajaxGet(stdAjaxPrefix + '&_mode=getpage&noheaders', function()
             {
-              if ( ajax.readyState == 4 )
+              if ( ajax.readyState == 4 && ajax.status == 200 )
               {
                 unsetAjaxLoading();
                 selectButtonMajor('article');
@@ -526,7 +526,7 @@
   }
   ajaxPost(stdAjaxPrefix + '&_mode=preview', 'text=' + ta_content, function()
     {
-      if ( ajax.readyState == 4 )
+      if ( ajax.readyState == 4 && ajax.status == 200 )
       {
         ajaxUnSetEditorLoading();
         changeOpac(0, 'enano_editor_preview');
@@ -551,7 +551,7 @@
   ajaxSetEditorLoading();
   ajaxGet(stdAjaxPrefix + '&_mode=getsource', function()
     {
-      if ( ajax.readyState == 4 )
+      if ( ajax.readyState == 4 && ajax.status == 200 )
       {
         ajaxUnSetEditorLoading();
         
@@ -601,7 +601,7 @@
   }
   ajaxPost(stdAjaxPrefix + '&_mode=diff_cur', 'text=' + ta_content, function()
     {
-      if ( ajax.readyState == 4 )
+      if ( ajax.readyState == 4 && ajax.status == 200 )
       {
         ajaxUnSetEditorLoading();
         changeOpac(0, 'enano_editor_preview');
--- a/includes/clientside/static/misc.js	Fri Feb 08 23:20:20 2008 -0500
+++ b/includes/clientside/static/misc.js	Sun Feb 10 19:35:06 2008 -0500
@@ -38,7 +38,7 @@
   rDnsObj = o;
   rDnsBannerObj = bannerOn('Retrieving reverse DNS info...');
   ajaxGet(stdAjaxPrefix+'&_mode=rdns&ip='+ipaddr, function() {
-      if(ajax.readyState == 4)
+      if ( ajax.readyState == 4 && ajax.status == 200 )
       {
         off = fetch_offset(rDnsObj);
         dim = fetch_dimensions(rDnsObj);
@@ -400,7 +400,7 @@
   _.src = scriptPath + "/images/good.gif";
   
   ajaxGet(makeUrlNS('Special', 'Login', 'act=getkey'), function() {
-      if ( ajax.readyState == 4 )
+      if ( ajax.readyState == 4 && ajax.status == 200 )
       {
         var response = String(ajax.responseText);
         if ( response.substr(0,1) != '{' )
@@ -611,7 +611,7 @@
   ajax_auth_mb_cache.updateContent(loading_win);
   
   ajaxPost(makeUrlNS('Special', 'Login', 'act=ajaxlogin'), 'params=' + json_data, function() {
-      if ( ajax.readyState == 4 )
+      if ( ajax.readyState == 4 && ajax.status == 200 )
       {
         var response = ajax.responseText;
         if ( response.substr(0,1) != '{' )
--- a/includes/render.php	Fri Feb 08 23:20:20 2008 -0500
+++ b/includes/render.php	Sun Feb 10 19:35:06 2008 -0500
@@ -223,6 +223,19 @@
     
     // Strip out <nowiki> sections and PHP code
     
+    $nw = preg_match_all('#<nowiki>(.*?)<\/nowiki>#is', $text, $nowiki);
+    
+    for($i=0;$i<sizeof($nowiki[1]);$i++)
+    {
+      $text = str_replace('<nowiki>'.$nowiki[1][$i].'</nowiki>', '{NOWIKI:'.$random_id.':'.$i.'}', $text);
+    }
+    
+    $code = $plugins->setHook('render_wikiformat_veryearly');
+    foreach ( $code as $cmd )
+    {
+      eval($cmd);
+    }
+    
     $php = preg_match_all('#<\?php(.*?)\?>#is', $text, $phpsec);
     
     for($i=0;$i<sizeof($phpsec[1]);$i++)
@@ -230,13 +243,6 @@
       $text = str_replace('<?php'.$phpsec[1][$i].'?>', '{PHP:'.$random_id.':'.$i.'}', $text);
     }
     
-    $nw = preg_match_all('#<nowiki>(.*?)<\/nowiki>#is', $text, $nowiki);
-    
-    for($i=0;$i<sizeof($nowiki[1]);$i++)
-    {
-      $text = str_replace('<nowiki>'.$nowiki[1][$i].'</nowiki>', '{NOWIKI:'.$random_id.':'.$i.'}', $text);
-    }
-    
     $text = preg_replace('/<noinclude>(.*?)<\/noinclude>/is', '\\1', $text);
     if ( $paths->namespace == 'Template' )
     {
@@ -636,6 +642,12 @@
     global $db, $session, $paths, $template, $plugins; // Common objects
     $random_id = md5( time() . mt_rand() );
     
+    $code = $plugins->setHook('render_sanitize_pre');
+    foreach ( $code as $cmd )
+    {
+      eval($cmd);
+    }
+    
     $can_do_php = ( $session->get_permissions('php_in_pages') && !$strip_all_php );
     $can_do_html = $session->get_permissions('html_in_pages');
     
@@ -672,6 +684,12 @@
     $text = str_replace('~~~~', "[[User:$session->username|$session->username]] ".enano_date('G:i, j F Y (T)'), $text);
     $text = str_replace('~~~', "[[User:$session->username|$session->username]] ", $text);
     
+    $code = $plugins->setHook('render_sanitize_post');
+    foreach ( $code as $cmd )
+    {
+      eval($cmd);
+    }
+    
     // Reinsert <nowiki> sections
     for($i=0;$i<$nw;$i++)
     {
--- a/includes/wikiformat.php	Fri Feb 08 23:20:20 2008 -0500
+++ b/includes/wikiformat.php	Sun Feb 10 19:35:06 2008 -0500
@@ -107,6 +107,13 @@
         if (is_array($rules)) {
             $this->rules = $rules;
         }
+        
+        global $plugins;
+        $code = $plugins->setHook('text_wiki_construct');
+        foreach ( $code as $cmd )
+        {
+            eval($cmd);
+        }
 
         $this->addPath(
             'parse',
--- a/install/includes/stages/database_mysql.php	Fri Feb 08 23:20:20 2008 -0500
+++ b/install/includes/stages/database_mysql.php	Sun Feb 10 19:35:06 2008 -0500
@@ -311,7 +311,7 @@
     
     ajaxPost(scriptPath + '/install/install.php?stage=database', connection_info + '&driver=mysql&ajax_test=on&language=' + enano_lang_code[ENANO_LANG_ID], function()
       {
-        if ( ajax.readyState == 4 )
+        if ( ajax.readyState == 4 && ajax.status == 200 )
         {
           setTimeout('install_unset_ajax_loading();', 750);
           // Process response
--- a/install/includes/stages/database_postgresql.php	Fri Feb 08 23:20:20 2008 -0500
+++ b/install/includes/stages/database_postgresql.php	Sun Feb 10 19:35:06 2008 -0500
@@ -252,7 +252,7 @@
     
     ajaxPost(scriptPath + '/install/install.php?stage=database', connection_info + '&driver=postgresql&ajax_test=on&language=' + enano_lang_code[ENANO_LANG_ID], function()
       {
-        if ( ajax.readyState == 4 )
+        if ( ajax.readyState == 4 && ajax.status == 200 )
         {
           setTimeout('install_unset_ajax_loading();', 750);
           // Process response
--- a/install/includes/stages/website.php	Fri Feb 08 23:20:20 2008 -0500
+++ b/install/includes/stages/website.php	Sun Feb 10 19:35:06 2008 -0500
@@ -34,7 +34,7 @@
   }
   var __ajaxMrwTest_chain_rewrite = function()
   {
-    if ( ajax.readyState == 4 )
+    if ( ajax.readyState == 4 && ajax.status == 200 )
     {
       if ( ajax.responseText == 'good_rewrite' )
       {
@@ -48,7 +48,7 @@
   }
   var __ajaxMrwTest_chain_shortened = function()
   {
-    if ( ajax.readyState == 4 )
+    if ( ajax.readyState == 4 && ajax.status == 200 )
     {
       if ( ajax.responseText == 'good_shortened' )
       {
@@ -62,7 +62,7 @@
   }
   var __ajaxMrwTest_chain_standard = function()
   {
-    if ( ajax.readyState == 4 )
+    if ( ajax.readyState == 4 && ajax.status == 200 )
     {
       if ( ajax.responseText == 'good_standard' )
       {
--- a/plugins/SpecialAdmin.php	Fri Feb 08 23:20:20 2008 -0500
+++ b/plugins/SpecialAdmin.php	Sun Feb 10 19:35:06 2008 -0500
@@ -2186,7 +2186,7 @@
       }
       document.getElementById('ajaxPageContainer').innerHTML = '<div class="wait-box">Loading page...</div>';
       ajaxGet('<?php echo scriptPath; ?>/ajax.php?title='+t+'&_mode=getpage&noheaders&auth=<?php echo $session->sid_super; ?>', function() {
-          if(ajax.readyState == 4) {
+          if ( ajax.readyState == 4 && ajax.status == 200 ) {
             document.getElementById('ajaxPageContainer').innerHTML = ajax.responseText;
             fadeInfoBoxes();
           }
--- a/plugins/SpecialUserFuncs.php	Fri Feb 08 23:20:20 2008 -0500
+++ b/plugins/SpecialUserFuncs.php	Sun Feb 10 19:35:06 2008 -0500
@@ -938,7 +938,7 @@
             
             document.getElementById('e_username').innerHTML = '<br /><small><b>' + $lang.get('user_reg_msg_username_checking') + '</b></small>';
             ajaxGet('<?php echo scriptPath; ?>/ajax.php?title=null&_mode=checkusername&name='+escape(frm.username.value), function() {
-              if(ajax.readyState == 4)
+              if ( ajax.readyState == 4 && ajax.status == 200 )
                 if(ajax.responseText == 'good')
                 {
                   document.getElementById('s_username').src='<?php echo scriptPath; ?>/images/check.png';