Changeset 683 for trunk


Ignore:
Timestamp:
11/27/2011 09:32:32 PM (6 months ago)
Author:
ofer
Message:

Much stricter widget class checking

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/WordPress/plugin/transposh/wp/transposh_widget.php

    r681 r683  
    164164        foreach ($activewidgets as $key => $v) { 
    165165            $class = $this->load_widget($key); 
    166             $class::tp_widget_css($key, $this->transposh->transposh_plugin_dir, $this->transposh->transposh_plugin_url); 
     166            if (class_exists($class)) 
     167                    $class::tp_widget_css($key, $this->transposh->transposh_plugin_dir, $this->transposh->transposh_plugin_url); 
    167168        } 
    168169        logger('Added transposh_widget_css', 4); 
     
    184185        foreach ($activewidgets as $key => $v) { 
    185186            $class = $this->load_widget($key); 
    186             $class::tp_widget_js($key, $this->transposh->transposh_plugin_dir, $this->transposh->transposh_plugin_url); 
     187            if (class_exists($class)) 
     188                    $class::tp_widget_js($key, $this->transposh->transposh_plugin_dir, $this->transposh->transposh_plugin_url); 
    187189        } 
    188190        logger('Added transposh_widget_js', 4); 
     
    242244        // we load the class needed and get its base name for later 
    243245        $class = $this->load_widget($instance['widget_file']); 
     246        if (!class_exists($class)) { 
     247            echo __('Transposh subwidget was not loaded correctly').": $class"; 
     248        } 
    244249 
    245250        $clean_page = $this->transposh->get_clean_url(); 
Note: See TracChangeset for help on using the changeset viewer.