Show
Ignore:
Timestamp:
04/04/11 14:51:28 (2 years ago)
Author:
plg
Message:

compatibility with Piwigo 2.2 (remove "adviser", get_comment_post_key()
replaced by get_ephemeral_key(), known_script replaced by combine_script
and use of combine_css)

textarea is no more "resizable" (useless and break CSS rules)

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • extensions/ContactForm/classes/cf_plugin.class.php

    r9070 r10035  
    187187        'cf_messages' => realpath(cf_get_template('cf_messages.tpl')), 
    188188      )); 
    189     $template->block_html_head( '', 
    190               '<link rel="stylesheet" type="text/css" '. 
    191               'href="' . CF_INCLUDE . 'contactform.css' . '">', 
    192               $smarty, $repeat); 
    193     $template->block_html_head( '', 
    194               '<script type="text/javascript" '. 
    195               'src="' . CF_INCLUDE . 'contactform.js' . '">'. 
    196               '</script>', 
    197               $smarty, $repeat); 
     189     
    198190    $cf = array( 
    199191        'TITLE'     => 'contact_form_title', 
     
    207199        'SUBJECT'   => $infos['cf_subject'], 
    208200        'MESSAGE'   => $infos['cf_message'], 
    209         'KEY'       => get_comment_post_key($infos['cf_id']), 
     201        'KEY'       => get_ephemeral_key(2, $infos['cf_id']), 
    210202      ); 
    211203    if (!empty($infos['errors'])) { 
     
    463455      $id = trim( stripslashes($_POST['cf_id'])); 
    464456    } 
    465      
    466     $key = explode( ':', $key ); 
    467     if ( count($key)!=2 
    468           or $key[0]>time()-2 // page must have been retrieved more than 2 sec ago 
    469           or $key[0]<time()-3600 // 60 minutes expiration 
    470           or hash_hmac( 
    471                 'md5', $key[0].':'.$id, $conf['secret_key'] 
    472               ) != $key[1] 
    473         ) 
    474     { 
     457 
     458    if (!verify_ephemeral_key($key, $id)) { 
    475459      return false; 
    476460    }