Merging in fixes and updates from 90b7a52bea45
authorDan
Sat, 03 Nov 2007 07:40:54 -0400
changeset 228 b0a4d179be85
parent 197 90b7a52bea45 (diff)
parent 227 0eca1498a77b (current diff)
child 229 97ae8e9d5e29
Merging in fixes and updates from 90b7a52bea45
ajax.php
includes/common.php
includes/constants.php
includes/functions.php
includes/render.php
includes/sessions.php
includes/template.php
index.php
install.php
plugins/SpecialAdmin.php
plugins/admin/PageGroups.php
schema.sql
upgrade.php
upgrade.sql
--- a/includes/common.php	Sat Nov 03 07:30:11 2007 -0400
+++ b/includes/common.php	Sat Nov 03 07:40:54 2007 -0400
@@ -68,6 +68,9 @@
 if ( file_exists( ENANO_ROOT . '/_nightly.php') )
   require(ENANO_ROOT.'/_nightly.php');
 
+// List of scheduled tasks
+$cron_tasks = array();
+
 // Start including files. LOTS of files. Yeah!
 require_once(ENANO_ROOT.'/includes/constants.php');
 dc_here('Enano CMS '.$version.' (dev) - debug window<br />Powered by debugConsole');
--- a/includes/constants.php	Sat Nov 03 07:30:11 2007 -0400
+++ b/includes/constants.php	Sat Nov 03 07:40:54 2007 -0400
@@ -73,7 +73,7 @@
 define('MAX_PMS_PER_BATCH', 7); // The maximum number of users that users can send PMs to in one go; restriction does not apply to users with mod_misc rights
 define('SEARCH_RESULTS_PER_PAGE', 10);
 define('MYSQL_MAX_PACKET_SIZE', 1048576); // 1MB; this is the default in MySQL 4.x I think
-define('SEARCH_MODE', 'BUILTIN'); // Can be FULLTEXT or BUILTIN
+define('SEARCH_MODE', 'FULLTEXT'); // Can be FULLTEXT or BUILTIN
 
 // Sidebar
 
--- a/includes/functions.php	Sat Nov 03 07:30:11 2007 -0400
+++ b/includes/functions.php	Sat Nov 03 07:40:54 2007 -0400
@@ -2804,7 +2804,7 @@
   $strip_tags = implode('|', $strip_tags);
   
   // Strip out the tags and replace with placeholders
-  preg_match_all("#<($strip_tags)(.*?)>(.*?)</($strip_tags)>#is", $html, $matches);
+  preg_match_all("#<($strip_tags)([ ]+.*?)?>(.*?)</($strip_tags)>#is", $html, $matches);
   $seed = md5(microtime() . mt_rand()); // Random value used for placeholders
   for ($i = 0;$i < sizeof($matches[1]); $i++)
   {
@@ -2812,7 +2812,7 @@
   }
   
   // Optimize (but don't obfuscate) Javascript
-  preg_match_all('/<script(.*?)>(.+?)<\/script>/is', $html, $jscript);
+  preg_match_all('/<script([ ]+.*?)?>(.*?)(\]\]>)?<\/script>/is', $html, $jscript);
   
   // list of Javascript reserved words - from about.com
   $reserved_words = array('abstract', 'as', 'boolean', 'break', 'byte', 'case', 'catch', 'char', 'class', 'continue', 'const', 'debugger', 'default', 'delete', 'do',
--- a/plugins/admin/PageGroups.php	Sat Nov 03 07:30:11 2007 -0400
+++ b/plugins/admin/PageGroups.php	Sat Nov 03 07:40:54 2007 -0400
@@ -2,7 +2,7 @@
 
 /*
  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.1.1
+ * Version 1.0.2 (Coblynau)
  * Copyright (C) 2006-2007 Dan Fuhry
  *
  * This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License
@@ -602,6 +602,23 @@
                   echo '<div class="info-box">The affecting tag was updated.</div>';
               }
             }
+            else if ( $_POST['pg_type'] == PAGE_GRP_REGEX )
+            {
+              $target = $_POST['pg_target'];
+              if ( empty($target) )
+              {
+                echo '<div class="error-box">Please enter an expression to match against..</div>';
+              }
+              else
+              {
+                $target = $db->escape($target);
+                $q = $db->sql_query('UPDATE '.table_prefix.'page_groups SET pg_target=\'' . $target . '\' WHERE pg_id=' . $edit_id . ';');
+                if ( !$q )
+                  $db->_die();
+                else
+                  echo '<div class="info-box">The expression to match against was updated.</div>';
+              }
+            }
             else if ( $_POST['pg_type'] == PAGE_GRP_CATLINK )
             {
               $target = $_POST['pg_target'];
@@ -860,6 +877,22 @@
                   </td>
                 </tr>';
           break;
+        case PAGE_GRP_REGEX:
+          echo '<tr>
+                  <td class="row2">
+                    Regular expression to use:<br />
+                    <small>Be sure to include the starting and ending delimiters and any flags you might need.<br />
+                           These pages might help: <a href="http://us.php.net/manual/en/reference.pcre.pattern.modifiers.php">Pattern modifiers</a> &bull;
+                           <a href="http://us.php.net/manual/en/reference.pcre.pattern.syntax.php">Pattern syntax</a><br />
+                           Examples: <tt>/^(Special|Admin):/i</tt> &bull; <tt>/^Image:([0-9]+)$/</tt><br />
+                           Developers, remember that this will be matched against the full page identifier string. This means that <tt>/^About_Enano$/</tt>
+                           will NOT match the page Special:About_Enano.</small>
+                  </td>
+                  <td class="row1">
+                    <input type="text" name="pg_target" value="' . htmlspecialchars($row['pg_target']) . '" size="30" />
+                  </td>
+                </tr>';
+          break;
         case PAGE_GRP_CATLINK:
           
           // Build category list