Nothing special, just syncing to Scribus, several bugs have been found with GET forms and a fix is in the works
authorDan
Tue, 04 Sep 2007 08:25:48 -0400
changeset 114 47393c6619ea
parent 113 6f357b951f7a
child 115 261f367623af
Nothing special, just syncing to Scribus, several bugs have been found with GET forms and a fix is in the works
includes/template.php
plugins/SpecialSearch.php
--- a/includes/template.php	Sun Sep 02 00:33:22 2007 -0400
+++ b/includes/template.php	Tue Sep 04 08:25:48 2007 -0400
@@ -731,6 +731,7 @@
       'ADMIN_SID_AMP'=>$asa,
       'ADMIN_SID_AMP_HTML'=>$ash,
       'ADMIN_SID_AUTO'=>$as2,
+      'ADMIN_SID_RAW'=> ( is_string($session->sid_super) ? $session->sid_super : '' ),
       'ADDITIONAL_HEADERS'=>$this->additional_headers,
       'COPYRIGHT'=>RenderMan::parse_internal_links(getConfig('copyright_notice')),
       'TOOLBAR_EXTRAS'=>$this->toolbar_menu,
--- a/plugins/SpecialSearch.php	Sun Sep 02 00:33:22 2007 -0400
+++ b/plugins/SpecialSearch.php	Tue Sep 04 08:25:48 2007 -0400
@@ -84,6 +84,18 @@
     }
   }
   $q = trim($q);
+  
+  if ( !empty($q) && !isset($_GET['search']) )
+  {
+    list($pid, $ns) = RenderMan::strToPageID($q);
+    $pid = sanitize_page_id($pid);
+    $key = $paths->nslist[$ns] . $pid;
+    if ( isPage($key) )
+    {
+      redirect(makeUrl($key), 'Results', 'found page', 0);
+    }
+  }
+  
   $template->header();
   if(!empty($q))
   {
@@ -96,7 +108,7 @@
       $q_tl = strtolower( str_replace('_', ' ', $q) );
       $p_lc = strtolower($pg['urlname']);
       $p_tl = strtolower($pg['name']);
-      if ( strstr($p_tl, $q_tl) || strstr($p_lc, $q_lc) )
+      if ( strstr($p_tl, $q_tl) || strstr($p_lc, $q_lc) && $pg['visible'] == 1 )
       {
         echo '<div class="usermessage">Perhaps you were looking for <b><a href="' . makeUrl($pg['urlname'], false, true) . '">' . htmlspecialchars($pg['name']) . '</a></b>?</div>';
         break;
@@ -229,7 +241,10 @@
     ?>
     <form action="<?php echo makeUrl($paths->page); ?>" method="get">
       <p>
-        <input type="text" name="q" size="40" value="<?php echo htmlspecialchars( $q ); ?>" />  <input type="submit" value="Search" />  <small><a href="<?php echo makeUrlNS('Special', 'Search'); ?>">Advanced Search</a></small>
+        <?php if ( $session->sid_super ): ?>
+          <input type="hidden" name="auth" value="<?php echo $session->sid_super; ?>" />
+        <?php endif; ?>
+        <input type="text" name="q" size="40" value="<?php echo htmlspecialchars( $q ); ?>" /> <input type="submit" value="Go" style="font-weight: bold;" /> <input name="search" type="submit" value="Search" />  <small><a href="<?php echo makeUrlNS('Special', 'Search'); ?>">Advanced Search</a></small>
       </p>
     </form>
     <?php