Changeset 28839


Ignore:
Timestamp:
06/29/14 16:21:03 (5 years ago)
Author:
mistic100
Message:

use new maintain class

Location:
extensions/ContactForm
Files:
1 added
1 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • extensions/ContactForm/admin/config.php

    r28343 r28839  
    3333    'cf_redirect_url' =>      $_POST['cf_redirect_url'], 
    3434    ); 
    35   $conf['ContactForm_before'] = $_POST['cf_before']; 
    36   $conf['ContactForm_after'] = $_POST['cf_after']; 
    3735 
    38   conf_update_param('ContactForm', pwg_db_real_escape_string(serialize($conf['ContactForm']))); 
    39   conf_update_param('ContactForm_before', $conf['ContactForm_before']); 
    40   conf_update_param('ContactForm_after', $conf['ContactForm_after']); 
     36  conf_update_param('ContactForm', $conf['ContactForm']); 
     37  conf_update_param('ContactForm_before', trim($_POST['cf_before']), true); 
     38  conf_update_param('ContactForm_after', trim($_POST['cf_after']), true); 
    4139 
    4240  $page['infos'][] = l10n('Information data registered in database'); 
  • extensions/ContactForm/include/functions.inc.php

    r28628 r28839  
    141141 
    142142  $conf['ContactForm']['cf_must_initialize'] = false; 
    143   conf_update_param('ContactForm', serialize($conf['ContactForm'])); 
     143  conf_update_param('ContactForm', $conf['ContactForm']); 
    144144} 
    145145 
  • extensions/ContactForm/main.inc.php

    r28324 r28839  
    1313 */ 
    1414 
    15 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); 
     15defined('PHPWG_ROOT_PATH') or die('Hacking attempt!'); 
    1616 
    1717global $prefixeTable; 
    1818 
    19 defined('CONTACT_FORM_ID') or define('CONTACT_FORM_ID', basename(dirname(__FILE__))); 
    20 define('CONTACT_FORM_PATH',    PHPWG_PLUGINS_PATH . CONTACT_FORM_ID . '/'); 
    21 define('CONTACT_FORM_ADMIN',   get_root_url() . 'admin.php?page=plugin-' . CONTACT_FORM_ID); 
    22 define('CONTACT_FORM_PUBLIC',  get_absolute_root_url() . make_index_url(array('section' => 'contact')) . '/'); 
    23 define('CONTACT_FORM_TABLE',   $prefixeTable .'contact_form'); 
    24 define('CONTACT_FORM_VERSION', 'auto'); 
     19define('CONTACT_FORM_ID',     basename(dirname(__FILE__))); 
     20define('CONTACT_FORM_PATH',   PHPWG_PLUGINS_PATH . CONTACT_FORM_ID . '/'); 
     21define('CONTACT_FORM_ADMIN',  get_root_url() . 'admin.php?page=plugin-' . CONTACT_FORM_ID); 
     22define('CONTACT_FORM_PUBLIC', get_absolute_root_url() . make_index_url(array('section' => 'contact')) . '/'); 
     23define('CONTACT_FORM_TABLE',  $prefixeTable .'contact_form'); 
     24 
     25include(CONTACT_FORM_PATH . 'include/functions.inc.php'); 
    2526 
    2627 
     
    4041add_event_handler('before_parse_mail_template', 'contact_form_mail_template', EVENT_HANDLER_PRIORITY_NEUTRAL, 2); 
    4142 
    42 include(CONTACT_FORM_PATH . 'include/functions.inc.php'); 
    43  
    4443 
    4544/** 
     
    4847function contact_form_init() 
    4948{ 
    50   global $conf, $template, $pwg_loaded_plugins; 
     49  global $conf, $template; 
    5150 
    52   include_once(CONTACT_FORM_PATH . 'maintain.inc.php'); 
    53   $maintain = new ContactForm_maintain(CONTACT_FORM_ID); 
    54   $maintain->autoUpdate(CONTACT_FORM_VERSION, 'install'); 
    55  
    56   $conf['ContactForm'] = unserialize($conf['ContactForm']); 
     51  $conf['ContactForm'] = safe_unserialize($conf['ContactForm']); 
     52   
    5753  load_language('plugin.lang', CONTACT_FORM_PATH); 
    5854  load_language('lang', PHPWG_ROOT_PATH.PWG_LOCAL_DIR, array('no_fallback'=>true, 'local'=>true)); 
Note: See TracChangeset for help on using the changeset viewer.