adriangreen
Forum Replies Created
-
Forum: Plugins
In reply to: [Advanced Contact form 7 DB] Wrong submit timeI can confirm that it is still happening. The time is UTC, not the local time (date.timezone =”country/place” PHP config).
Slightly difficult solution:
My preference would be for the submit_time to stay as UTC but for the data presentation (exports, admin forms) to show the DateTime in the defined timezone. Additionally the logic would be applied to all the SQL used.
Trivial solution:
Save the data in the local timezone.
DIY solution:
Use the vsz_cf7_posted_data filter:function example_cf7_modify_form_before_insert_data( $posted_data ) { $timestamp = WPCF7_Submission::get_instance()->get_meta( 'timestamp' ); if ( $timestamp ) { $date = ( new DateTime( '', new DateTimezone( wp_timezone_string() ) ) )->setTimestamp( $timestamp ); $posted_data['submit_time'] = $date->format( 'Y-m-d H:i:s' ); } return $posted_data; }- This reply was modified 5 years, 5 months ago by adriangreen. Reason: remove hard-coded timezone string
Forum: Plugins
In reply to: [Advanced Code Editor] Restoring a commit does not work properly.It can easily be avoided, but I don’t think the author cares. The plugin is clearly incomplete in it’s realization. I stopped using it. Idea: The data could be stored using base64_encode/decode to avoid all these issues.
You’re best going to the author for a proper fix…Potential Solution:
Edit .htacess and place this at the top (outside of BWS block) so that it won’t be overwritten by BWS.
# BEGIN BWS AI1EC FIX <IfModule mod_rewrite.c> RewriteCond %{QUERY_STRING} !^.*(request_type).* [NC] </IfModule> # END BWS AI1EC FIXWorks for me.
Forum: Plugins
In reply to: [Advanced Code Editor] Restoring a commit does not work properly.…aaaanyway
the simple fix for this is to not use
esc_sqlin functionajax_commit_fileas subsequent call toadd_metadatasanitizes input anyhow, it’s a bit redundant:$file_content = /**esc_sql**/($_POST['file_content']);Forum: Plugins
In reply to: [Advanced Code Editor] Restoring a commit does not work properly.Problem isolated:
the problem is that on commit the code calls func
add_file_metawhich then calls built-in func
add_metadata
– this function uses funcwp_unslashon the passed in value.wp_unslashremoves escape slashes like in
O\'Brian>>O'BrianSo our poor newlines are being converted to “n”
2 newlines next \n\nNewline here>>newline next nnNewline hereForum: Plugins
In reply to: [Advanced Code Editor] Restoring a commit does not work properly.I can confirm this in version 2.2.5.
Clearly an escaping issue…<?phpn/**n *…The malformed html is present in the database table
filemetaso it’s getting mangled on “commit”.