Changeset 12325

Show
Ignore:
Timestamp:
09/17/07 12:06:56 (1 year ago)
Author:
bergie
Message:

Minor bulletproofing

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/midcom/midcom.helper.search/viewer.php

    r11907 r12325  
    9696        $indexer =& $_MIDCOM->get_service('indexer'); 
    9797         
     98        // Sane defaults for REQUEST vars 
     99        if (!isset($_REQUEST['type'])) 
     100        { 
     101            $_REQUEST['type'] = 'basic'; 
     102        } 
     103        if (!isset($_REQUEST['page'])) 
     104        { 
     105            $_REQUEST['page'] = 1; 
     106        } 
     107        if (!isset($_REQUEST['component'])) 
     108        { 
     109            $_REQUEST['component'] = ''; 
     110        } 
     111        if (!isset($_REQUEST['topic'])) 
     112        { 
     113            $_REQUEST['topic'] = ''; 
     114        } 
     115        if (!isset($_REQUEST['lastmodified'])) 
     116        { 
     117            $_REQUEST['lastmodified'] = 0; 
     118        } 
     119         
     120        // If we don't have a query string, relocate to empty search form 
     121        if (!isset($_REQUEST['query'])) 
     122        { 
     123            if ($data['type'] == 'basic') 
     124            { 
     125                $_MIDCOM->relocate(''); 
     126            } 
     127            $_MIDCOM->relocate('advanced/'); 
     128        } 
     129 
    98130        $data['type'] = $_REQUEST['type']; 
    99          
    100131        switch ($data['type']) 
    101132        {