Ignore:
Timestamp:
Dec 9, 2013, 5:34:37 PM (10 years ago)
Author:
mistic100
Message:

update for 2.6

File:
1 edited

Legend:

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

    r24348 r25872  
    55if (isset($_POST['save_config']))
    66{
    7   $was_ready = $conf['ContactForm']['cf_ready'];
    8  
     7  if ($_POST['cf_redirect_url']=='http://')
     8  {
     9    $_POST['cf_redirect_url'] = null;
     10  }
     11  else if (!empty($_POST['cf_redirect_url']))
     12  {
     13    if (strpos($_POST['cf_redirect_url'], 'http') !== 0)
     14    {
     15      $_POST['cf_redirect_url'] = 'http://' . $_POST['cf_redirect_url'];
     16    }
     17    if (!url_check_format($_POST['cf_redirect_url']))
     18    {
     19      $page['errors'][] = l10n('Invalid redirect URL');
     20      $_POST['cf_redirect_url'] = $conf['ContactForm']['cf_redirect_url'];
     21    }
     22  }
     23
    924  $conf['ContactForm'] = array(
    1025    'cf_must_initialize' =>   false,
     
    1631    'cf_mandatory_name' =>    isset($_POST['cf_mandatory_name']),
    1732    'cf_mail_type' =>         $_POST['cf_mail_type'],
    18     'cf_redirect_url' =>      ($_POST['cf_redirect_url']!='http://') ? $_POST['cf_redirect_url'] : null,
    19     'cf_theme' =>             $_POST['cf_theme'],
     33    'cf_redirect_url' =>      $_POST['cf_redirect_url'],
    2034    );
    2135  $conf['ContactForm_before'] = $_POST['cf_before'];
    2236  $conf['ContactForm_after'] = $_POST['cf_after'];
    23  
     37
    2438  conf_update_param('ContactForm', serialize($conf['ContactForm']));
    2539  conf_update_param('ContactForm_before', $conf['ContactForm_before']);
    2640  conf_update_param('ContactForm_after', $conf['ContactForm_after']);
    27  
    28   $conf['ContactForm']['cf_ready'] = $was_ready;
    29  
    30   array_push($page['infos'], l10n('Information data registered in database'));
     41
     42  $page['infos'][] = l10n('Information data registered in database');
    3143}
    3244
     
    4052
    4153$template->set_filename('contact_form', realpath(CONTACT_FORM_PATH . 'admin/template/config.tpl'));
    42 
    43 ?>
Note: See TracChangeset for help on using the changeset viewer.