Oops, never merged in updates from ee1fc84f12a8 (240)
authorDan
Wed, 28 Nov 2007 14:47:42 -0500
changeset 299 ce2873735506
parent 298 39c132e69781 (current diff)
parent 297 ee1fc84f12a8 (diff)
child 300 c9e192a059c1
Oops, never merged in updates from ee1fc84f12a8 (240)
includes/functions.php
--- a/.hgtags	Wed Nov 28 14:46:03 2007 -0500
+++ b/.hgtags	Wed Nov 28 14:47:42 2007 -0500
@@ -7,3 +7,4 @@
 42c6c83b8a004163c9cc2d85f3c8eada3b73adf6 rebrand
 d53cc29308f4f4b97fc6d054e9e0855f37137409 rebrand
 90632c09ed7ec816da708df1341d9f4019de9adf feature-freeze
+f948557af0681389165a23419968965fcebcbdd0 devel-freeze
--- a/includes/clientside/static/misc.js	Wed Nov 28 14:46:03 2007 -0500
+++ b/includes/clientside/static/misc.js	Wed Nov 28 14:47:42 2007 -0500
@@ -634,6 +634,6 @@
 
 function validateEmail(email)
 {
-  return ( email.match(/^(?:[\w\d]+\.?)+@((?:(?:[\w\d]\-?)+\.)+\w{2,4}|localhost)$/) ) ? true : false;
+  return ( email.match(/^(?:[\w\d_-]+\.?)+@((?:(?:[\w\d_-]\-?)+\.)+\w{2,4}|localhost)$/) ) ? true : false;
 }
 
--- a/includes/constants.php	Wed Nov 28 14:46:03 2007 -0500
+++ b/includes/constants.php	Wed Nov 28 14:47:42 2007 -0500
@@ -293,6 +293,22 @@
   'xwd'     => 'image/x-xwindowdump',
   'xyz'     => 'chemical/x-xyz',
   'zip'     => 'application/zip',
+  'odt' => 'application/vnd.oasis.opendocument.text',
+  'ott' => 'application/vnd.oasis.opendocument.text-template',
+  'odg' => 'application/vnd.oasis.opendocument.graphics',
+  'otg' => 'application/vnd.oasis.opendocument.graphics-template',
+  'odp' => 'application/vnd.oasis.opendocument.presentation',
+  'otp' => 'application/vnd.oasis.opendocument.presentation-template',
+  'ods' => 'application/vnd.oasis.opendocument.spreadsheet',
+  'ots' => 'application/vnd.oasis.opendocument.spreadsheet-template',
+  'odc' => 'application/vnd.oasis.opendocument.chart',
+  'otc' => 'application/vnd.oasis.opendocument.chart-template',
+  'odi' => 'application/vnd.oasis.opendocument.image',
+  'oti' => 'application/vnd.oasis.opendocument.image-template',
+  'odf' => 'application/vnd.oasis.opendocument.formula',
+  'otf' => 'application/vnd.oasis.opendocument.formula-template',
+  'odm' => 'application/vnd.oasis.opendocument.text-master',
+  'oth' => 'application/vnd.oasis.opendocument.text-web'
 );
 
 $mimetype_extlist = Array(
@@ -415,6 +431,22 @@
   'x-conference/x-cooltalk'=>'ice',
   // Added for Enano
   'image/xcf' => 'xcf xcfbz2 xcf.bz2',
+  'application/vnd.oasis.opendocument.text' => 'odt',
+  'application/vnd.oasis.opendocument.text-template' => 'ott',
+  'application/vnd.oasis.opendocument.graphics' => 'odg',
+  'application/vnd.oasis.opendocument.graphics-template' => 'otg',
+  'application/vnd.oasis.opendocument.presentation' => 'odp',
+  'application/vnd.oasis.opendocument.presentation-template' => 'otp',
+  'application/vnd.oasis.opendocument.spreadsheet' => 'ods',
+  'application/vnd.oasis.opendocument.spreadsheet-template' => 'ots',
+  'application/vnd.oasis.opendocument.chart' => 'odc',
+  'application/vnd.oasis.opendocument.chart-template' => 'otc',
+  'application/vnd.oasis.opendocument.image' => 'odi',
+  'application/vnd.oasis.opendocument.image-template' => 'oti',
+  'application/vnd.oasis.opendocument.formula' => 'odf',
+  'application/vnd.oasis.opendocument.formula-template' => 'otf',
+  'application/vnd.oasis.opendocument.text-master' => 'odm',
+  'application/vnd.oasis.opendocument.text-web' => 'oth'
 );
 
 $k = array_keys($mime_types);
--- a/includes/dbal.php	Wed Nov 28 14:46:03 2007 -0500
+++ b/includes/dbal.php	Wed Nov 28 14:47:42 2007 -0500
@@ -773,6 +773,15 @@
               </tr>';
       }
     }
+    if ( function_exists('array_sum') )
+    {
+      $query_time_total = array_sum($this->query_times);
+      echo '<tr>
+              <th class="subhead" colspan="2">
+                Total time taken for SQL queries: ' . round( $query_time_total, 6 ) . ' seconds
+              </th>
+            </tr>';
+    }
     echo '  </table>
           </div>';
     $template->footer();
--- a/includes/functions.php	Wed Nov 28 14:46:03 2007 -0500
+++ b/includes/functions.php	Wed Nov 28 14:47:42 2007 -0500
@@ -2709,7 +2709,7 @@
 /**
  * Aggressively and hopefully non-destructively optimizes a blob of HTML.
  * @param string HTML to process
- * @return string much snaller HTML
+ * @return string much smaller HTML
  */
 
 function aggressive_optimize_html($html)
--- a/install.php	Wed Nov 28 14:46:03 2007 -0500
+++ b/install.php	Wed Nov 28 14:47:42 2007 -0500
@@ -979,6 +979,7 @@
     <table border="0" cellspacing="0" cellpadding="0">
     <?php
     run_test('return version_compare(\'4.3.0\', PHP_VERSION, \'<\');', 'PHP Version >=4.3.0', 'It seems that the version of PHP that your server is running is too old to support Enano properly. If this is your server, please upgrade to the most recent version of PHP, remembering to use the --with-mysql configure option if you compile it yourself. If this is not your server, please contact your webhost and ask them if it would be possible to upgrade PHP. If this is not possible, you will need to switch to a different webhost in order to use Enano.');
+    run_test('return version_compare(\'5.2.0\', PHP_VERSION, \'<\');', 'PHP 5.2.0 or later', 'Your server does not have support for PHP 5.2.0. While you may continue installing Enano, please be warned that as of December 31, 2007, all support for Enano on PHP 4 servers is discontinued. If you have at least PHP 5.0.0, support will still be available, but there are many security problems in PHP versions under 5.2.0 that Enano cannot effectively prevent.', true);
     run_test('return function_exists(\'mysql_connect\');', 'MySQL extension for PHP', 'It seems that your PHP installation does not have the MySQL extension enabled. If this is your own server, you may need to just enable the "libmysql.so" extension in php.ini. If you do not have the MySQL extension installed, you will need to either use your distribution\'s package manager to install it, or you will have to compile PHP from source. If you compile PHP from source, please remember to use the "--with-mysql" configure option, and you will have to have the MySQL development files installed (they usually are). If this is not your server, please contact your hosting company and ask them to install the PHP MySQL extension.');
     run_test('return @ini_get(\'file_uploads\');', 'File upload support', 'It seems that your server does not support uploading files. Enano *requires* this functionality in order to work properly. Please ask your server administrator to set the "file_uploads" option in php.ini to "On".');
     run_test('return is_apache();', 'Apache HTTP Server', 'Apparently your server is running a web server other than Apache. Enano will work nontheless, but there are some known bugs with non-Apache servers, and the "fancy" URLs will not work properly. The "Standard URLs" option will be set on the website configuration page, only change it if you are absolutely certain that your server is running Apache.', true);
@@ -996,7 +997,7 @@
       <?php
       if($warned) {
         echo '<table border="0" cellspacing="0" cellpadding="0">';
-        run_test('return false;', 'Some scalebacks were made due to your server configuration.', 'Enano has detected that some of the features or configuration settings on your server are not optimal for the best behavior and/or performance for Enano. As a result, certain features or enhancements that are part of Enano have been disabled to prevent further errors. You have seen those "fatal error" notices that spew from PHP, haven\'t you?<br /><br />Fatal error:</b> call to undefined function wannahokaloogie() in file <b>'.__FILE__.'</b> on line <b>'.__LINE__.'', true);
+        run_test('return false;', 'Some of the features of Enano have been turned off to accommodate your server.', 'Enano has detected that some of the features or configuration settings on your server are not optimal for the best behavior and/or performance for Enano. As a result, Enano has disabled these features as a precaution to prevent errors and potential security issues.', true);
         echo '</table>';
       } else {
         echo '<table border="0" cellspacing="0" cellpadding="0">';
@@ -1377,7 +1378,7 @@
           document.getElementById(\'s_password\').src = \'images/bad.gif\';
           ret = false;
         }
-        if(frm.admin_email.value.match(/^(?:[\\w\\d]+\\.?)+@(?:(?:[\\w\\d]\\-?)+\\.)+\\w{2,4}$/))
+        if(frm.admin_email.value.match(/^(?:[\\w\\d_-]+\\.?)+@(?:(?:[\\w\\d-]\\-?)+\\.)+\\w{2,4}$/))
         {
           document.getElementById(\'s_email\').src = \'images/good.gif\';
         }
--- a/plugins/SpecialAdmin.php	Wed Nov 28 14:46:03 2007 -0500
+++ b/plugins/SpecialAdmin.php	Wed Nov 28 14:47:42 2007 -0500
@@ -756,6 +756,7 @@
     $t = -1;
     $cl = 'row1';
     echo "\n".'    <div class="tblholder">'."\n".'      <table cellspacing="1" cellpadding="2" style="margin: 0; padding: 0;" border="0">'."\n".'        <tr>'."\n        ";
+    ksort($mime_types);
     foreach($mime_types as $e => $m)
     {
       $c++;
--- a/schema.sql	Wed Nov 28 14:46:03 2007 -0500
+++ b/schema.sql	Wed Nov 28 14:47:42 2007 -0500
@@ -271,7 +271,7 @@
   ('copyright_notice', '{{COPYRIGHT}}'),
   ('wiki_edit_notice_text', '== Why can I edit this page? ==\n\nEveryone can edit almost any page in this website. This concept is called a wiki. It gives everyone the opportunity to make a change for the best. While some spam and vandalism may occur, it is believed that most contributions will be legitimate and helpful.\n\nFor security purposes, a history of all page edits is kept, and administrators are able to restore vandalized or spammed pages with just a few clicks.'),
   ('cache_thumbs', '{{ENABLE_CACHE}}'),
-  ('max_file_size', '256000'),('enano_version', '{{VERSION}}'),( 'allowed_mime_types', 'cbf:len=168;crc=c3dcad3f;data=0[1],1[4],0[3],1[1],0[2],1[1],0[11],1[1],0[7],1[1],0[9],1[1],0[6],1[3],0[10],1[1],0[2],1[2],0[1],1[1],0[1],1[2],0[6],1[3],0[1],1[1],0[2],1[4],0[1],1[2],0[3],1[1],0[4],1[2],0[26],1[5],0[6],1[2],0[2],1[1],0[4],1[1],0[10],1[2],0[1],1[1],0[6]|end' ),
+  ('max_file_size', '256000'),('enano_version', '{{VERSION}}'),( 'allowed_mime_types', 'cbf:len=185;crc=55fb6f14;data=0[1],1[4],0[3],1[1],0[22],1[1],0[16],1[3],0[16],1[1],0[1],1[2],0[6],1[1],0[1],1[1],0[4],1[2],0[3],1[1],0[48],1[2],0[2],1[1],0[4],1[1],0[37]|end' ),
   ('contact_email', '{{ADMIN_EMAIL}}'),
   ('powered_btn', '1');
 
--- a/upgrade.php	Wed Nov 28 14:46:03 2007 -0500
+++ b/upgrade.php	Wed Nov 28 14:47:42 2007 -0500
@@ -93,7 +93,7 @@
     '1.0b4' => Array('u_1_0_RC1_update_user_ids', 'u_1_0_RC1_add_admins_to_group', 'u_1_0_RC1_alter_files_table', 'u_1_0_RC1_destroy_session_cookie', 'u_1_0_RC1_set_contact_email', 'u_1_0_RC1_update_page_text'), // ,
     // '1.0RC2' => Array('u_1_0_populate_userpage_comments')
     '1.0RC3' => Array('u_1_0_RC3_make_users_extra'),
-    '1.0.2b1' => Array('u_1_0_2_nuke_template_cache')
+    '1.0.2b1' => Array('u_1_0_2_nuke_template_cache', 'u_1_0_2_rebuild_search_index')
   );
 
 if(!isset($_GET['mode'])) 
@@ -457,6 +457,13 @@
   }
 }
 
+function u_1_0_2_rebuild_search_index()
+{
+  global $paths;
+  @set_time_limit(0);
+  $paths->rebuild_search_index();
+}
+
 switch($_GET['mode'])
 {
   case "login":
--- a/upgrade.sql	Wed Nov 28 14:46:03 2007 -0500
+++ b/upgrade.sql	Wed Nov 28 14:47:42 2007 -0500
@@ -17,6 +17,7 @@
 ALTER TABLE {{TABLE_PREFIX}}pages MODIFY COLUMN urlname varchar(255), MODIFY COLUMN name varchar(255);
 ALTER TABLE {{TABLE_PREFIX}}page_text MODIFY COLUMN page_id varchar(255), MODIFY COLUMN namespace varchar(63), MODIFY COLUMN page_text longtext;
 @CREATE FULLTEXT INDEX {{TABLE_PREFIX}}page_search_idx ON {{TABLE_PREFIX}}page_text(page_id, namespace, page_text);
+UPDATE {{TABLE_PREFIX}}config SET config_value='cbf:len=185;crc=55fb6f14;data=0[1],1[4],0[3],1[1],0[22],1[1],0[16],1[3],0[16],1[1],0[1],1[2],0[6],1[1],0[1],1[1],0[4],1[2],0[3],1[1],0[48],1[2],0[2],1[1],0[4],1[1],0[37]|end' WHERE config_name = 'allowed_mime_types' AND config_value='cbf:len=168;crc=c3dcad3f;data=0[1],1[4],0[3],1[1],0[2],1[1],0[11],1[1],0[7],1[1],0[9],1[1],0[6],1[3],0[10],1[1],0[2],1[2],0[1],1[1],0[1],1[2],0[6],1[3],0[1],1[1],0[2],1[4],0[1],1[2],0[3],1[1],0[4],1[2],0[26],1[5],0[6],1[2],0[2],1[1],0[4],1[1],0[10],1[2],0[1],1[1],0[6]|end';
 ---END 1.0.2b1---
 ---BEGIN 1.0.1.1---
 ---END 1.0.1.1---