Changeset 8


Ignore:
Timestamp:
Aug 30, 2005 9:32:53 PM (19 years ago)
Author:
scdev
Message:

checking isset($this) on self-instanciating function calls in App and DB.

Location:
trunk/lib
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/App.inc.php

    r7 r8  
    162162    function setParam($param=null)
    163163    {
    164         if (!is_a($this, 'App')) {
     164        if (!isset($this) || !is_a($this, 'App')) {
    165165            $this =& App::getInstance();
    166166        }
     
    181181    function &getParam($param=null)
    182182    {
    183         if (!is_a($this, 'App')) {
     183        if (!isset($this) || !is_a($this, 'App')) {
    184184            $this =& App::getInstance();
    185185        }
     
    353353    function raiseMsg($message, $type=MSG_NOTICE, $file=null, $line=null)
    354354    {
    355         if (!is_a($this, 'App')) {
     355        if (!isset($this) || !is_a($this, 'App')) {
    356356            $this =& App::getInstance();
    357357        }
     
    382382    function printRaisedMessages()
    383383    {
    384         if (!is_a($this, 'App')) {
     384        if (!isset($this) || !is_a($this, 'App')) {
    385385            $this =& App::getInstance();
    386386        }
     
    439439    function logMsg($message, $priority=LOG_INFO, $file=null, $line=null)
    440440    {
    441         if (!is_a($this, 'App')) {
     441        if (!isset($this) || !is_a($this, 'App')) {
    442442            $this =& App::getInstance();
    443443        }
     
    561561    function oHREF($url='', $carry_args=null, $always_include_sid=false)
    562562    {
    563         if (!is_a($this, 'App')) {
     563        if (!isset($this) || !is_a($this, 'App')) {
    564564            $this =& App::getInstance();
    565565        }
     
    683683    function printHiddenSession($carry_args=null)
    684684    {
    685         if (!is_a($this, 'App')) {
     685        if (!isset($this) || !is_a($this, 'App')) {
    686686            $this =& App::getInstance();
    687687        }
     
    768768    function dieURL($url, $carry_args=null, $always_include_sid=false)
    769769    {
    770         if (!is_a($this, 'App')) {
     770        if (!isset($this) || !is_a($this, 'App')) {
    771771            $this =& App::getInstance();
    772772        }
     
    806806    function dieBoomerangURL($id=null, $carry_args=null)
    807807    {
    808         if (!is_a($this, 'App')) {
     808        if (!isset($this) || !is_a($this, 'App')) {
    809809            $this =& App::getInstance();
    810810        }
     
    849849    function setBoomerangURL($url=null, $id=null)
    850850    {
    851         if (!is_a($this, 'App')) {
     851        if (!isset($this) || !is_a($this, 'App')) {
    852852            $this =& App::getInstance();
    853853        }
     
    890890    function getBoomerangURL($id=null)
    891891    {
    892         if (!is_a($this, 'App')) {
     892        if (!isset($this) || !is_a($this, 'App')) {
    893893            $this =& App::getInstance();
    894894        }
     
    918918    function deleteBoomerangURL($id=null)
    919919    {
    920         if (!is_a($this, 'App')) {
     920        if (!isset($this) || !is_a($this, 'App')) {
    921921            $this =& App::getInstance();
    922922        }
     
    941941    function validBoomerangURL($id=null, $use_nonspecificboomerang=false)
    942942    {
    943         if (!is_a($this, 'App')) {
     943        if (!isset($this) || !is_a($this, 'App')) {
    944944            $this =& App::getInstance();
    945945        }
     
    990990    function sslOn()
    991991    {
    992         if (!is_a($this, 'App')) {
     992        if (!isset($this) || !is_a($this, 'App')) {
    993993            $this =& App::getInstance();
    994994        }
  • trunk/lib/DB.inc.php

    r7 r8  
    8585    function setParam($params)
    8686    {
    87         if (!is_a($this, 'DB')) {
     87        if (!isset($this) || !is_a($this, 'DB')) {
    8888            $this =& DB::getInstance();
    8989        }
     
    108108    function getParam($param)
    109109    {
    110         if (!is_a($this, 'DB')) {
     110        if (!isset($this) || !is_a($this, 'DB')) {
    111111            $this =& DB::getInstance();
    112112        }
     
    129129    function connect()
    130130    {
    131         if (!is_a($this, 'DB')) {
     131        if (!isset($this) || !is_a($this, 'DB')) {
    132132            $this =& DB::getInstance();
    133133        }
     
    175175    function close()
    176176    {
    177         if (!is_a($this, 'DB')) {
     177        if (!isset($this) || !is_a($this, 'DB')) {
    178178            $this =& DB::getInstance();
    179179        }
     
    196196    function getDBH()
    197197    {
    198         if (!is_a($this, 'DB')) {
     198        if (!isset($this) || !is_a($this, 'DB')) {
    199199            $this =& DB::getInstance();
    200200        }
     
    231231        static $_query_count = 0;
    232232       
    233         if (!is_a($this, 'DB')) {
     233        if (!isset($this) || !is_a($this, 'DB')) {
    234234            $this =& DB::getInstance();
    235235        }
     
    277277    function tableExists($table, $use_cached_results=true)
    278278    {   
    279         if (!is_a($this, 'DB')) {
     279        if (!isset($this) || !is_a($this, 'DB')) {
    280280            $this =& DB::getInstance();
    281281        }
     
    311311    function columnExists($table, $columns, $strict=true, $use_cached_results=true)
    312312    {   
    313         if (!is_a($this, 'DB')) {
     313        if (!isset($this) || !is_a($this, 'DB')) {
    314314            $this =& DB::getInstance();
    315315        }
  • trunk/lib/DBSessionHandler.inc.php

    r7 r8  
    6262        }
    6363
    64         if (!is_a($this->db, 'DB') || !$this->db->isConnected()) {
     64        if (!isset($this) || !is_a($this->db, 'DB') || !$this->db->isConnected()) {
    6565            trigger_error('Invalid DB object or unable to connect to database.', E_USER_ERROR);
    6666        }
  • trunk/lib/Nav.inc.php

    r7 r8  
    109109     * @return bool true on success, false on failure
    110110     */
    111     function getFeature($feature, $page_id=null)
     111    function getFeature($feature, $page_id=null, $default=null)
    112112    {
    113113        if (!isset($page_id)) {
     
    126126                return $this->pages[$page_id]['features'][$feature];
    127127            }
     128        } else {
     129            return $default;
    128130        }
    129131    }
Note: See TracChangeset for help on using the changeset viewer.