martinburchell
Forum Replies Created
-
Forum: Plugins
In reply to: [Validated] Validation occasionally fails with 2 undefined property errorsAwesome!
Thanks for the quick turnaround.
Forum: Plugins
In reply to: [Syndicate Out] Avoid storing of credentials on sending serverWe ended up adding filters when the options were loaded and saved, using the example from the mcrypt_encrypt() PHP documentation:
function decrypt_password( $settings ) { $key = get_encryption_key(); $iv_size = mcrypt_get_iv_size( MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC ); if ( isset( $settings['group'] ) && is_array( $settings['group'] ) ) { foreach ( $settings['group'] as $group_id => &$group_settings ) { if ( isset( $group_settings['servers'] ) && is_array( $group_settings['servers'] ) ) { foreach ( $group_settings['servers'] as $server_id => &$server_details ) { $ciphertext = base64_decode( $server_details['password'] ); $iv = substr( $ciphertext, 0, $iv_size ); $ciphertext = substr( $ciphertext, $iv_size ); $padded_password = mcrypt_decrypt( MCRYPT_RIJNDAEL_128, $key, $ciphertext, MCRYPT_MODE_CBC, $iv ); $server_details['password'] = rtrim( $padded_password ); } } } } return $settings; } add_filter( 'option_so_options', 'decrypt_password' ); function encrypt_password( $settings, $old_settings ) { $key = get_encryption_key(); $iv_size = mcrypt_get_iv_size( MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC ); if ( isset( $settings['group'] ) && is_array( $settings['group'] ) ) { foreach ( $settings['group'] as $group_id => &$group_settings ) { if ( isset( $group_settings['servers'] ) && is_array( $group_settings['servers'] ) ) { foreach ( $group_settings['servers'] as $server_id => &$server_details ) { $iv = mcrypt_create_iv( $iv_size, MCRYPT_RAND ); $ciphertext = mcrypt_encrypt( MCRYPT_RIJNDAEL_128, $key, $server_details['password'], MCRYPT_MODE_CBC, $iv ); $ciphertext = $iv . $ciphertext; $server_details['password'] = base64_encode( $ciphertext ); } } } } return $settings; } add_filter( 'pre_update_option_so_options', 'encrypt_password' );
Forum: Plugins
In reply to: [Simple Calendar - Google Calendar Plugin] Does the plugin now assume HTML5?Thanks for your help Nick
Yes it is XHTML strict. I’m guessing the validator rejects any attributes it doesn’t recognise. In practical terms it probably doesn’t make any difference to the operation of my site, but I like to run a validator on all of the pages to check for more critical things like tags not being properly closed. The less noise the validator produces the better.
Forum: Plugins
In reply to: [Simple Calendar - Google Calendar Plugin] Does the plugin now assume HTML5?2.0.3.1
I’ll see how much effort it would be to update my theme to use HTML 5.
Hi Nick
That won’t work because all of the events across several days are contained within the div element with class gce-list-grouped.
I’ll put in a feature request as you suggest.