From fc8d51ea6a08bd70eeb557eb87fbe78d4905d35d Mon Sep 17 00:00:00 2001 From: Remco Tolsma Date: Thu, 12 Feb 2015 12:30:15 +0100 Subject: [PATCH 1/3] Node doesn't allow 4 digits. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index fe26bcf..2b6c447 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "gravityforms", - "version": "1.9.1.6", + "version": "1.9.1", "description": "Easily create web forms and manage form entries within the WordPress admin.", "repository": { "type": "git", From a392b3a34320123abdb381ccd183ab8a83c3ae7e Mon Sep 17 00:00:00 2001 From: Remco Tolsma Date: Thu, 12 Feb 2015 12:30:41 +0100 Subject: [PATCH 2/3] Grunt makepot. --- languages/gravityforms.pot | 25 +++++++------------------ 1 file changed, 7 insertions(+), 18 deletions(-) diff --git a/languages/gravityforms.pot b/languages/gravityforms.pot index 3a292d9..531c29d 100644 --- a/languages/gravityforms.pot +++ b/languages/gravityforms.pot @@ -1,28 +1,17 @@ -# Copyright 2009-2015 Rocketgenius, Inc. +# Copyright (C) 2015 rocketgenius +# This file is distributed under the same license as the Gravity Forms package. msgid "" msgstr "" "Project-Id-Version: Gravity Forms 1.9.1.6\n" -"Report-Msgid-Bugs-To: http://www.gravtiyhelp.com\n" -"POT-Creation-Date: 2015-02-11 23:24:25+00:00\n" +"Report-Msgid-Bugs-To: http://wordpress.org/support/plugin/gravityforms\n" +"POT-Creation-Date: 2015-02-12 11:30:24+00:00\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" "PO-Revision-Date: 2015-MO-DA HO:MI+ZONE\n" -"Last-Translator: Rocketgenius \n" -"Language-Team: Rocketgenius \n" -"X-Generator: Gravity Forms Build Server\n" -"X-Poedit-KeywordsList: " -"__;_e;_x:1,2c;_ex:1,2c;_n:1,2;_nx:1,2,4c;_n_noop:1,2;_nx_noop:1,2,3c;esc_" -"attr__;esc_html__;esc_attr_e;esc_html_e;esc_attr_x:1,2c;esc_html_x:1,2c;\n" -"Project-Id-Version: Gravity Forms\n" -"Language: en_US\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" -"X-Poedit-Basepath: ../\n" -"X-Poedit-Bookmarks: \n" -"X-Poedit-Country: United States\n" -"X-Poedit-SearchPath-0: .\n" -"X-Poedit-SourceCharset: utf-8\n" -"X-Textdomain-Support: yes\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"X-Generator: grunt-wp-i18n 0.4.9\n" #: common.php:316 common.php:626 form_detail.php:2561 msgid "Insert Merge Tag" From 2e12f615cfd864a0a2d9f5a4ac3f5107a004fd9b Mon Sep 17 00:00:00 2001 From: Remco Tolsma Date: Thu, 26 Feb 2015 13:57:04 +0100 Subject: [PATCH 3/3] Manual update from 1.9.1.6 to 1.9.2. --- change_log.txt | 97 +- common.php | 39 +- css/admin.css | 48 +- css/formsmain.css | 435 ++--- css/readyclass.css | 660 ++++--- entry_detail.php | 2 +- entry_list.php | 12 +- form_detail.php | 37 +- form_display.php | 6 +- form_list.php | 6 +- forms_model.php | 28 +- gravityforms.php | 128 +- includes/addon/class-gf-addon.php | 113 +- includes/addon/class-gf-payment-addon.php | 4 +- includes/api.php | 17 +- includes/fields/class-gf-field-address.php | 4 +- includes/fields/class-gf-field-captcha.php | 2 +- includes/fields/class-gf-field-date.php | 20 +- includes/fields/class-gf-field-email.php | 6 +- includes/fields/class-gf-field-fileupload.php | 5 +- includes/fields/class-gf-field-name.php | 19 + includes/fields/class-gf-field-password.php | 6 +- includes/fields/class-gf-field-post-tags.php | 1 + includes/upload.php | 17 +- includes/webapi/webapi.php | 78 +- js/datepicker.js | 10 + js/form_admin.js | 6 +- js/form_editor.js | 5 +- js/gravityforms.js | 2 +- js/gravityforms.min.js | 2 +- js/jquery.maskedinput-1.3.1.min.js | 6 +- js/jquery.maskedinput.min.js | 7 + languages/gravityforms-es_ES.mo | Bin 163683 -> 167612 bytes languages/gravityforms-fi.mo | Bin 163853 -> 163843 bytes languages/gravityforms-fr_FR.mo | Bin 172778 -> 163955 bytes languages/gravityforms.pot | 1534 +++++++++-------- package.json | 2 +- preview.php | 1 + 38 files changed, 1742 insertions(+), 1623 deletions(-) create mode 100644 js/jquery.maskedinput.min.js diff --git a/change_log.txt b/change_log.txt index 7e43117..cab1622 100644 --- a/change_log.txt +++ b/change_log.txt @@ -1,29 +1,88 @@ ------------------------------------------------------------------------------------------------------------------- -Version 1.9.1.6 - - Added 'svg-painter' to list of no conflict scripts - - Updated GFForms::get_admin_icon_b64() method to support a $color parameter for fetching the SVG icon in different colors +Version 1.9.2 + - Added the disabled attribute to the datepicker input in the form editor. + - Added support for the field placeholder as an available choice in the conditional logic value drop down. + - Added self-healing security precautions. + - Added security precautions. + - Added THE BEST FIX EVER for on-going IE issues with the datepicker + - Added security precautions to updates. + - Added the gform_upload_root_htaccess_rules filter to allow the .htaccess file rules to be removed or modified. Please consult your system administrator before using this filter. Example: + add_filter( 'gform_upload_root_htaccess_rules', '__return_false' ); + - Added extra CSS classes for name field to help in styling them. + - Added the gform_enable_shortcode_notification_message hook back, allowing shortcode processing of notification messages to be disabled. + - Added context to some strings to allow a better translation. + - Added 'svg-painter' to list of no conflict scripts. + - Updated the field type drop down on the Custom Field in the form editor to use optgroup for the standard fields and the advanced fields option headers. + - Updated the gform_address_display_format filter to also have access to the $field. + add_filter( 'gform_address_display_format', function ( $format, $field ) { + return $field->form_id == 40 ? 'zip_before_city' : $format; + }, 10, 2 ); + - Updated Payment Add-On Framework cron job schedule to hourly instead of daily. + - Updated Masked Input script to latest version. + - Updated Finnish translation file. + - Updated small fix to French translation. + - Updated Spanish (es_ES) translation. + - Updated GFForms::get_admin_icon_b64() method to support a $color parameter for fetching the SVG icon in different colors. $white_icon = GFForms::get_admin_icon_b64( '#fff' ); - -------------------------------------------------------------------------------------------------------------------- -Version 1.9.1.5 + - Fixed an issue in the form editor in Chrome for Windows where the conditional logic dependency confirmation pops up multiple times while editing a field with a dependency. + - Fixed issue with multi file upload field when applied to a post custom field. + - Fixed the loading of the Add Form button for custom admin pages using the gform_display_add_form_button filter. + - Fixed a deprecation notice related to the Captcha field when the Really Simple Captcha plugin is active. + - Fixed a JavaScript error on the WordPress edit attachment details page. + - Fixed a string in Spanish translation that caused a JS error in the entries list. + - Fixed a rare fatal error which would occur if a third-party plugin caused wp_mail() to return a WP_Error instance instead of the expected boolean. + - Fixed issue with GFFormDisplay::is_last_page() where "render" mode would return a false positive if validation failed + - Fixed issue when aggregating conditional logic default values for selects when no price is set on the selected choice + - Fixed issue with special characters on password field. + - Fixed inconsistency between GFForms::post() and rgpost() functions. + - Fixed issue with email validation when confirmation email is active. + - Fixed an issue which prevents List field columns from being sorted in the form editor. + - Fixed an issue with the multi-file field on the edit entry page where existing files are lost when adding new files. + - Fixed an issue with the Post Tags field in the form editor where the Default Value setting is missing. - Fixed a rare fatal error on some servers. - -------------------------------------------------------------------------------------------------------------------- -Version 1.9.1.4 - Fixed a fatal error caused by a conflict with some themes. - Fixed a XSS vulnerability. - -------------------------------------------------------------------------------------------------------------------- -Version 1.9.1.3 - Fixed an issue with the capability required to export forms. - -------------------------------------------------------------------------------------------------------------------- -Version 1.9.1.2 - - Fixed issue where tabbing through Date field would skip the next field in the tabindex - -------------------------------------------------------------------------------------------------------------------- -Version 1.9.1.1 + - Fixed issue where tabbing through Date field would skip the next field in the tabindex. - Fixed an issue with validation of the address field when the option to use values from another field is enabled and activated. + - Fixed an issue with the multi-file uploader not functioning when editing an entry if the user didn't have the gravityforms_edit_forms capability. + - Fixed an issue with notifications assigned to custom events, added via the gform_notification_events hook, being omitted from the resend notifications feature. + - AF: Fixed an issue with the way multi-input Email, Password, Date and Time fields are listed in field mapping drop downs when configuring a feed. + - AF: Updated GFAddOn::get_full_address() to use GF_Field_Address::get_country_code(). + - AF: Updated GFAddOn::get_full_name() to include the middle name value for multi-input Name fields. + - API: Added support for arrays as entry search term values combined with operators IN and NOT IN. Credit to Scott Kingsley Clark from Pods Framework. + Example: + $search_criteria = array( + 'status' => 'active', + 'field_filters' => array( + array( + 'key' => '2', + 'operator' => 'IN', // or 'NOT IN' + 'value' => array( 'Second Choice', 'Third Choice' ), + ), + ) + ); + - API: Added filters for each endpoint of the Web API to allow the capabilities to be modified. + - gform_web_api_capability_get_forms + - gform_web_api_capability_post_forms + - gform_web_api_capability_put_forms + - gform_web_api_capability_delete_forms + - gform_web_api_capability_put_forms_properties + - gform_web_api_capability_post_form_submissions + - gform_web_api_capability_get_entries + - gform_web_api_capability_post_entries + - gform_web_api_capability_put_entries + - gform_web_api_capability_put_entries_properties + - gform_web_api_capability_delete_entries + - gform_web_api_capability_get_results + Example: + add_filter( 'gform_web_api_capability_post_form_submissions', 'filter_gform_web_api_capability_post_form_submissions'); + function filter_gform_web_api_capability_post_form_submissions( $capability ) { + return 'my_capability_post_form_submissions'; + } + - API: Fixed fatal error if invalid entry id passed to GFAPI::update_entry_field(). + - API: Fixed a warning in the Web API while filtering entries. On some server configurations, and with debug enabled, WordPress may issue an array to string conversion warning when adding field filters to the search query arg. Although backwards compatibility remains, the entire search query arg should now be sent as a urlencoded JSON string. + - API: Fixed an issue with gform_get_meta and gform_update_meta which can result in multiple rows in the database for the same key if the value is updated with an empty string. ------------------------------------------------------------------------------------------------------------------- Version 1.9.1 diff --git a/common.php b/common.php index f70e67b..fa42bcf 100644 --- a/common.php +++ b/common.php @@ -155,7 +155,7 @@ public static function add_htaccess_file(){ if ( file_exists( $htaccess_file ) ) { unlink($htaccess_file); } - $txt= '# Disable parsing of PHP for some server configurations. + $txt= '# Disable parsing of PHP for some server configurations. This file may be removed or modified on certain server configurations by using by the gform_upload_root_htaccess_rules filter. Please consult your system administrator before removing this file. SetHandler none SetHandler default-handler @@ -166,8 +166,11 @@ public static function add_htaccess_file(){ php_flag engine off '; $rules = explode( "\n", $txt ); - insert_with_markers( $htaccess_file, 'Gravity Forms', $rules ); + $rules = apply_filters( 'gform_upload_root_htaccess_rules', $rules ); + if ( ! empty( $rules ) ) { + insert_with_markers( $htaccess_file, 'Gravity Forms', $rules ); + } } public static function clean_number( $number, $number_format = '' ) { @@ -1027,7 +1030,7 @@ public static function replace_variables_prepopulate( $text, $url_encode = false $text = str_replace( $full_tag, $value, $text ); } - $text = apply_filters( 'gform_replace_merge_tags', $text, false, $entry, $url_encode, false, false, false ); + $text = apply_filters( 'gform_replace_merge_tags', $text, false, $entry, $url_encode, $esc_html, false, false ); return $text; } @@ -1340,7 +1343,10 @@ private static function prepare_user_notification( $form, $lead, $override_optio $message_format = apply_filters( "gform_notification_format_{$form['id']}", apply_filters( 'gform_notification_format', 'html', 'user', $form, $lead ), 'user', $form, $lead ); $message = GFCommon::replace_variables( rgget( 'message', $form['autoResponder'] ), $form, $lead, false, false, ! rgget( 'disableAutoformat', $form['autoResponder'] ), $message_format ); - $message = do_shortcode( $message ); + + if ( apply_filters( 'gform_enable_shortcode_notification_message', true, $form, $lead ) ) { + $message = do_shortcode( $message ); + } //Running trough variable replacement $to = GFCommon::replace_variables( $to, $form, $lead, false, false ); @@ -1372,7 +1378,10 @@ private static function prepare_admin_notification( $form, $lead, $override_opti $message_format = apply_filters( "gform_notification_format_{$form['id']}", apply_filters( 'gform_notification_format', 'html', 'admin', $form, $lead ), 'admin', $form, $lead ); $message = GFCommon::replace_variables( rgget( 'message', $form['notification'] ), $form, $lead, false, false, ! rgget( 'disableAutoformat', $form['notification'] ), $message_format ); - $message = do_shortcode( $message ); + + if ( apply_filters( 'gform_enable_shortcode_notification_message', true, $form, $lead ) ) { + $message = do_shortcode( $message ); + } $version_info = self::get_version_info(); $is_expired = ! rgempty( 'expiration_time', $version_info ) && $version_info['expiration_time'] < time(); @@ -1480,7 +1489,10 @@ public static function send_notification( $notification, $form, $lead ) { $message_format = rgempty( 'message_format', $notification ) ? 'html' : rgar( $notification, 'message_format' ); $message = GFCommon::replace_variables( rgar( $notification, 'message' ), $form, $lead, false, false, ! rgar( $notification, 'disableAutoformat' ), $message_format ); - $message = do_shortcode( $message ); + + if ( apply_filters( 'gform_enable_shortcode_notification_message', true, $form, $lead ) ) { + $message = do_shortcode( $message ); + } // allow attachments to be passed as a single path (string) or an array of paths, if string provided, add to array $attachments = rgar( $notification, 'attachments' ); @@ -1573,7 +1585,9 @@ public static function get_notifications( $event, $form ) { $notifications = array(); foreach ( $form['notifications'] as $notification ) { - if ( rgar( $notification, 'event' ) == $event ) { + $notification_event = rgar( $notification, 'event' ); + $omit_from_resend = array( 'form_saved', 'form_save_email_requested' ); + if ( $notification_event == $event || ( $event == 'resend_notifications' && ! in_array( $notification_event, $omit_from_resend ) ) ) { $notifications[] = $notification; } } @@ -1643,8 +1657,9 @@ private static function send_email( $from, $to, $bcc, $reply_to, $subject, $mess GFCommon::log_debug( 'GFCommon::send_email(): Sending email via wp_mail().' ); GFCommon::log_debug( print_r( compact( 'to', 'subject', 'message', 'headers', 'attachments', 'abort_email' ), true ) ); $is_success = wp_mail( $to, $subject, $message, $headers, $attachments ); - GFCommon::log_debug( "GFCommon::send_email(): Result from wp_mail(): {$is_success}" ); - if ( $is_success ) { + $result = is_wp_error( $is_success ) ? $is_success->get_error_message() : $is_success; + GFCommon::log_debug( "GFCommon::send_email(): Result from wp_mail(): {$result}" ); + if ( ! is_wp_error( $is_success ) && $is_success ) { GFCommon::log_debug( 'GFCommon::send_email(): Mail was passed from WordPress to the mail server.' ); } else { GFCommon::log_error( 'GFCommon::send_email(): The mail message was passed off to WordPress for processing, but WordPress was unable to send the message.' ); @@ -2239,7 +2254,7 @@ public static function get_checkbox_choices( $field, $value, $disabled_text ) { } /** - * @deprecated + * @deprecated Deprecated since 1.9. Use GF_Field_Checkbox::get_radio_choices() instead. * * @param GF_Field_Radio $field * @param string $value @@ -3496,8 +3511,8 @@ public static function gf_vars( $echo = true ) { $gf_vars['thisFormButton'] = __( 'this form button if', 'gravityforms' ); $gf_vars['show'] = __( 'Show', 'gravityforms' ); $gf_vars['hide'] = __( 'Hide', 'gravityforms' ); - $gf_vars['all'] = __( 'All', 'gravityforms' ); - $gf_vars['any'] = __( 'Any', 'gravityforms' ); + $gf_vars['all'] = _x( 'All', 'Conditional Logic', 'gravityforms' ); + $gf_vars['any'] = _x( 'Any', 'Conditional Logic', 'gravityforms' ); $gf_vars['ofTheFollowingMatch'] = __( 'of the following match:', 'gravityforms' ); $gf_vars['is'] = __( 'is', 'gravityforms' ); $gf_vars['isNot'] = __( 'is not', 'gravityforms' ); diff --git a/css/admin.css b/css/admin.css index 32b2756..f4206fb 100644 --- a/css/admin.css +++ b/css/admin.css @@ -10,7 +10,7 @@ admin.css Gravity Forms Administration Styles http: //www.gravityforms.com -updated: January 22, 2015 9:27 AM +updated: February 17, 2015 11:53 AM Gravity Forms is a Rocketgenius project copyright 2008-2015 Rocketgenius Inc. @@ -471,6 +471,22 @@ img#gfield_input_datepicker_icon { clear: left; } +.ginput_complex.ginput_container.has_first_name span, +.ginput_complex.ginput_container.has_middle_name span, +.ginput_complex.ginput_container.has_last_name span { + width: 99.5% +} + +.ginput_complex.ginput_container.has_first_name.has_last_name span { + width: 49% +} + +.ginput_complex.ginput_container.has_first_name.has_middle_name.has_last_name span { + width: 32% +} + + + .top_label .gfield_label { display: block; margin: 8px 0 4px 0; @@ -4173,28 +4189,6 @@ table.form-table tr:last-child th { border: none !important; } -/* MP6 styles (Wp 3.8)- temporary ----------------------------------------------------*/ - - - -body.mp6 .field_edit_icon, -body.mp6 .form_edit_icon, -body.mp6 .field_delete_icon, -body.mp6 .form_delete_icon, -body.mp6 .field_duplicate_icon { - height: auto !important; -} - - -body.mp6 table tbody.user-list tr:nth-child(odd) { - background-color: #F9F9F9; -} - -body.mp6 #namediv input[type=checkbox], -body.mp6 #namediv input[type=radio] { - width: auto !important; -} - span.gf_settings_description { display: block; margin-top: 6px; @@ -4235,6 +4229,14 @@ a.gf_delete_field_choice:active { color: #444; } +/* form editor tweaks for 1.9 ----------------------------------------------------*/ + +span.ginput_left input.medium, +span.ginput_right input.medium, +.ginput_container.ginput_single_email input.medium { + width: 95% !important; +} + /* addon framework styles ----------------------------------------------------*/ diff --git a/css/formsmain.css b/css/formsmain.css index 361d514..0576325 100644 --- a/css/formsmain.css +++ b/css/formsmain.css @@ -4,7 +4,7 @@ Gravity Forms Front End Form Styles Version 1.9 http: //www.gravityforms.com -updated: February 5, 2015 12:25 PM +updated: February 18, 2015 10:54 AM Gravity Forms is a Rocketgenius project copyright 2008-2015 Rocketgenius Inc. @@ -77,6 +77,7 @@ to no. resize: none; } + .gform_wrapper ul { margin: 0 !important; list-style-type: none; @@ -246,11 +247,6 @@ html>body .entry ul, overflow: hidden; } -.gform_wrapper .field_name_first input, -.gform_wrapper .ginput_complex .ginput_left input { - width: 95% !important; -} - .gform_wrapper .field_name_last input { width: 93% !important; } @@ -260,19 +256,18 @@ html>body .entry ul, } .gform_wrapper .ginput_complex .ginput_left { - width: 49.5%; + width: 49%; float: left; } .gform_wrapper .ginput_complex .ginput_right { - width: 49.5%; + width: 49%; float: right; - margin-right: .5%; } .gform_wrapper .gfield_error .ginput_complex .ginput_left, .gform_wrapper .gfield_error .ginput_complex .ginput_right { - width: 49.5%; + width: 49%; } .gform_wrapper .gfield_error .ginput_complex .ginput_left input[type=text], @@ -298,9 +293,8 @@ html>body .entry ul, .gform_wrapper .ginput_complex input[type=email], .gform_wrapper .ginput_complex input[type=tel], .gform_wrapper .ginput_complex input[type=number], -.gform_wrapper .ginput_complex input[type=password], -.gform_wrapper .ginput_complex select { - width: 95% !important; +.gform_wrapper .ginput_complex input[type=password] { + width: 97.5%; } .gform_wrapper .ginput_complex .ginput_right input[type=text], @@ -309,10 +303,15 @@ html>body .entry ul, .gform_wrapper .ginput_complex .ginput_right input[type=tel], .gform_wrapper .ginput_complex .ginput_right input[type=number], .gform_wrapper .ginput_complex .ginput_right input[type=password], -.gform_wrapper .ginput_complex .ginput_right select { +.gform_wrapper .ginput_complex.ginput_container.has_first_name.has_last_name span.name_last input[type=text] { width: 95% !important; } +.gform_wrapper .ginput_complex .ginput_right select, +.gform_wrapper .ginput_complex select { + width: 97% !important; +} + .gform_wrapper .ginput_complex label, .gform_wrapper .gfield_time_hour label, .gform_wrapper .gfield_time_minute label, @@ -363,47 +362,108 @@ html>body .entry ul, width: auto !important; } +.gform_wrapper .ginput_complex span.name_suffix input[type=text] { + width: 48%; +} + .gform_wrapper .ginput_complex.has_middle span.name_suffix input[type=text] { width: 32%; } + + + .gform_wrapper .ginput_complex span.name_first, .gform_wrapper .ginput_complex span.name_middle, .gform_wrapper .ginput_complex span.name_last { vertical-align: bottom; min-height: 2.813em; - display: -moz-inline-stack; - display: inline-block; - zoom: 1; } -.gform_wrapper .ginput_complex span.name_first, -.gform_wrapper .ginput_complex span.name_middle { - margin-right: 0.313em; +.gform_wrapper .ginput_complex.ginput_container.has_first_name span, +.gform_wrapper .ginput_complex.ginput_container.has_middle_name span, +.gform_wrapper .ginput_complex.ginput_container.has_last_name span { + width: 99.5% } -.gform_wrapper .field_sublabel_above .ginput_complex .name_prefix, -.gform_wrapper .field_sublabel_above .ginput_complex span.name_suffix, -.gform_wrapper .field_sublabel_above .ginput_complex span.name_first, -.gform_wrapper .field_sublabel_above .ginput_complex span.name_middle, -.gform_wrapper .field_sublabel_above .ginput_complex span.name_last { - vertical-align: top; +.gform_wrapper .ginput_complex.ginput_container.has_first_name.has_last_name span.name_first { + float: left; + width: 49%; } -.gform_wrapper .ginput_complex.ginput_container.has_first_name span, -.gform_wrapper .ginput_complex.ginput_container.has_middle_name span, -.gform_wrapper .ginput_complex.ginput_container.has_last_name span { +.gform_wrapper .ginput_complex.ginput_container.has_first_name.has_last_name span.name_last { + float: right; + width: 49%; +} + +.gform_wrapper .ginput_complex.ginput_container.has_first_name.has_middle_name.has_last_name span.name_first, +.gform_wrapper .ginput_complex.ginput_container.has_first_name.has_middle_name.has_last_name span.name_middle, { + width: 32% !important; + float: left; +} +.gform_wrapper .ginput_complex.ginput_container.has_first_name.has_middle_name.has_last_name span.name_middle { + margin-left: 2%; +} + +.gform_wrapper .ginput_complex.ginput_container.has_first_name.has_middle_name.has_last_name span.name_last { + width: 32%; + float: right; +} + +/* make the name field spans full width if only one field is shown */ + +.gform_wrapper .ginput_complex.ginput_container.has_first_name.no_middle_name.no_last_name span, +.gform_wrapper .ginput_complex.ginput_container.no_first_name.has_middle_name.no_last_name span, +.gform_wrapper .ginput_complex.ginput_container.no_first_name.no_middle_name.has_last_name span { width: 99.5% } -.gform_wrapper .ginput_complex.ginput_container.has_first_name.has_last_name span { +/* make the name field spans 49% width if only two fields is shown */ + +.gform_wrapper .ginput_complex.ginput_container.has_first_name.no_middle_name.has_last_name span, +.gform_wrapper .ginput_complex.ginput_container.no_first_name.has_middle_name.has_last_name span, +.gform_wrapper .ginput_complex.ginput_container.has_first_name.has_middle_name.no_last_name span { width: 49% } +.gform_wrapper .ginput_complex.ginput_container.has_first_name.has_last_name span.name_last { + float: right; + width: 49%; +} + +/* make the name field spans 32% width if only two fields is shown */ + +.gform_wrapper .ginput_complex.ginput_container.has_first_name.has_middle_name.has_last_name { + width: 99%; +} + .gform_wrapper .ginput_complex.ginput_container.has_first_name.has_middle_name.has_last_name span { width: 32% } +.gform_wrapper .ginput_complex.ginput_container.has_first_name.has_middle_name.has_last_name span.name_first, +.gform_wrapper .ginput_complex.ginput_container.has_first_name.has_middle_name.has_last_name span.name_middle { + float: left; +} + +.gform_wrapper .ginput_complex.ginput_container.has_first_name.has_middle_name.has_last_name span.name_middle { + margin-left: 2%; +} + +.gform_wrapper .ginput_complex.ginput_container.has_first_name.has_middle_name.has_last_name span.name_lasgt { + float: right; +} + + + +.gform_wrapper .field_sublabel_above .ginput_complex .name_prefix, +.gform_wrapper .field_sublabel_above .ginput_complex span.name_suffix, +.gform_wrapper .field_sublabel_above .ginput_complex span.name_first, +.gform_wrapper .field_sublabel_above .ginput_complex span.name_middle, +.gform_wrapper .field_sublabel_above .ginput_complex span.name_last { + vertical-align: top; +} + .gform_wrapper .top_label .gfield_label { margin: 0.625em 0 0.500em 0; font-weight: bold; @@ -483,26 +543,26 @@ body .gform_wrapper label.gfield_label + div.ginput_container { } .gform_wrapper .top_label input.small, -.gform_wrapper .top_label select.small { +.gform_wrapper .top_label select.small, +.gform_wrapper .top_label textarea.textarea.small, +.gform_wrapper .hidden_label textarea.textarea.small { width: 25%; } .gform_wrapper .top_label input.medium, -.gform_wrapper .top_label select.medium { - width: 47%; -} - -.gform_wrapper .top_label input.medium { - padding-right: 2px; +.gform_wrapper .top_label select.medium, +.gform_wrapper .top_label textarea.textarea.medium, +.gform_wrapper .hidden_label textarea.textarea.medium { + width: 48%; } .gform_wrapper .top_label input.large, .gform_wrapper .top_label select.large, -.gform_wrapper .top_label textarea.textarea, +.gform_wrapper .top_label textarea.textarea.large, .gform_wrapper .hidden_label input.large, .gform_wrapper .hidden_label select.large, -.gform_wrapper .hidden_label textarea.textarea { - width: 99.2%; +.gform_wrapper .hidden_label textarea.textarea.large { + width: 97.5%; } .gform_wrapper .right_label input.small, @@ -828,7 +888,7 @@ div.gf_page_steps+div.validation_error { .gform_wrapper .ginput_complex .ginput_full input[type=tel], .gform_wrapper .ginput_complex .ginput_full input[type=number], .gform_wrapper .ginput_complex .ginput_full input[type=password] { - width: 97% !important; + width: 97.5% !important; } .gform_wrapper .gfield_checkbox li, @@ -1089,6 +1149,17 @@ body .gform_wrapper ul.gform_fields li.gfield.gform_validation_container { clear: both; } +.gform_wrapper .gform_page_footer .button.gform_previous_button, +.gform_wrapper .gform_page_footer .button.gform_next_button { + display: -moz-inline-stack; + display: inline-block; + zoom: 1; +} + +.gform_wrapper .gform_page_footer .button.gform_previous_button { + margin-bottom: 0.500em; +} + .gform_wrapper .gform_page_footer .button.gform_next_button, .gform_wrapper .gform_page_footer .button.gform_button { margin-right: 0.625em; @@ -2111,20 +2182,6 @@ body .gform_wrapper div.gform_body ul.gform_fields li.gfield.gfield_html dl dd { margin-bottom: 1px; } -/* simple confirmation message styling ------------------------------------------------------*/ - -.gform_confirmation_message { - margin: 1em 0 1em 0; - padding: 1em; - font-size: 1em; - border: 2px solid #CFE2C0; - background-color: #E9FFD9; - text-align: center; - -webkit-border-radius: 2px; - -moz-border-radius: 2px; - border-radius: 2px; -} - /* saved message confirmation ------------------------------------------------------*/ .form_saved_message { @@ -2186,7 +2243,7 @@ body .gform_wrapper form .gform_body .gform_fields .gfield .ginput_container #re line-height: 1em !important; } -/* define datepicker image size to override generic theme image styles ------------------------------------------------------*/ +/* define date picker image size to override generic theme image styles ------------------------------------------------------*/ body .gform_wrapper img.ui-datepicker-trigger { width: 17px !important; @@ -2199,270 +2256,4 @@ body .gform_wrapper img.ui-datepicker-trigger { body .gform_wrapper img.add_list_item, body .gform_wrapper img.delete_list_item { display: -moz-inline-stack; display: inline-block; zoom: 1; -} - - -/* Responsive Layout Changes -------------------------------------------------------*/ - -@media screen and (max-width: 570px) and (min-width: 480px) { - - body .gform_wrapper .ginput_complex.ginput_container.has_first_name span, - body .gform_wrapper .ginput_complex.ginput_container.has_middle_name span, - body .gform_wrapper .ginput_complex.ginput_container.has_last_name span { - width: 95% - } - - body .gform_wrapper .ginput_complex.ginput_container.has_first_name.has_last_name span { - width: 46% - } - - body .gform_wrapper .ginput_complex.ginput_container.has_first_name.has_middle_name.has_last_name span { - width: 30% - } - -} - -@media all and (max-width: 480px), all and (max-device-width: 480px) { - - body .gform_wrapper ul li.gfield, - body .gform_wrapper .ginput_container, - body .gform_wrapper div.ginput_complex, - body .gform_wrapper div.ginput_complex span, - body .gform_wrapper div.ginput_complex span.ginput_left, - body .gform_wrapper div.ginput_complex span.ginput_right, - body .gform_wrapper div.gfield_password_strength, - body .gform_wrapper div.gf_page_steps, - body .gform_wrapper div.gf_page_steps div { - display: block !important; - float: none !important; - clear: both !important; - margin-left: 0 !important; - margin-right: 0 !important; - } - - body .gform_wrapper ul li.gfield[style="display: none;"] { - display:none !important; - } - - body .gform_wrapper .ginput_container, - body .gform_wrapper div.ginput_complex, - body .gform_wrapper div.gf_page_steps, - body .gform_wrapper div.gf_page_steps div { - width: 95% !important; - } - - body .gform_wrapper div.gfield_password_strength { - width: 90% !important; - } - - body .gform_wrapper ul li.gfield, - body .gform_wrapper div.ginput_complex span, - body .gform_wrapper div.ginput_complex span.ginput_left, - body .gform_wrapper div.ginput_complex span.ginput_right { - width: 100% !important; - } - - body .gform_wrapper .ginput_complex .ginput_right input[type=text], - body .gform_wrapper .ginput_complex .ginput_right input[type=url], - body .gform_wrapper .ginput_complex .ginput_right input[type=email], - body .gform_wrapper .ginput_complex .ginput_right input[type=tel], - body .gform_wrapper .ginput_complex .ginput_right input[type=number], - body .gform_wrapper .ginput_complex .ginput_right input[type=password], - body .gform_wrapper .ginput_complex .ginput_left input[type=text], - body .gform_wrapper .ginput_complex .ginput_left input[type=url], - body .gform_wrapper .ginput_complex .ginput_left input[type=email], - body .gform_wrapper .ginput_complex .ginput_left input[type=tel], - body .gform_wrapper .ginput_complex .ginput_left input[type=number], - body .gform_wrapper .ginput_complex .ginput_left input[type=password], - body .gform_wrapper .ginput_complex .ginput_full input[type=text], - body .gform_wrapper .ginput_complex .ginput_full input[type=url], - body .gform_wrapper .ginput_complex .ginput_full input[type=email], - body .gform_wrapper .ginput_complex .ginput_full input[type=tel], - body .gform_wrapper .ginput_complex .ginput_full input[type=number], - body .gform_wrapper .ginput_complex .ginput_full input[type=password], - body .gform_wrapper .ginput_complex .ginput_full select, - body .gform_wrapper input.gform_button.button, - body .gform_wrapper input[type=submit] { - width: 95% !important; - } - - body .gform_wrapper .ginput_container input.small, - body .gform_wrapper .ginput_container input.medium, - body .gform_wrapper .ginput_container input.large, - body .gform_wrapper .ginput_container select.small, - body .gform_wrapper .ginput_container select.medium, - body .gform_wrapper .ginput_container select.large, - body .gform_wrapper .ginput_container textarea.small, - body .gform_wrapper .ginput_container textarea.medium, - body .gform_wrapper .ginput_container textarea.large { - width: 95% !important; - } - - body .gform_wrapper div.chosen-container.chosen-container-single[style] { - width: 95% !important; - } - - body .gform_wrapper img.ui-datepicker-trigger { - display: none !important; - } - - body .gform_wrapper .gfield_time_hour input, - body .gform_wrapper .gfield_time_minute input, - body .gform_wrapper .gfield_date_month input, - body .gform_wrapper .gfield_date_day input, - body .gform_wrapper .gfield_date_year input { - width: 95% !important; - } - - body .gform_wrapper .gfield_time_hour i { - display: none !important; - } - - body .gform_wrapper .ginput_complex input[type=text], - body .gform_wrapper .ginput_complex input[type=url], - body .gform_wrapper .ginput_complex input[type=email], - body .gform_wrapper .ginput_complex input[type=tel], - body .gform_wrapper .ginput_complex input[type=number], - body .gform_wrapper .ginput_complex input[type=password] { - width: 95% !important; - } - - body .gform_wrapper .ginput_complex .ginput_right input[type=text], - body .gform_wrapper .ginput_complex .ginput_right input[type=url], - body .gform_wrapper .ginput_complex .ginput_right input[type=email], - body .gform_wrapper .ginput_complex .ginput_right input[type=tel], - body .gform_wrapper .ginput_complex .ginput_right input[type=number], - body .gform_wrapper .ginput_complex .ginput_right input[type=password] { - width: 95% !important; - } - - body .gform_wrapper .gfield_error .ginput_complex .ginput_left input[type=text], - body .gform_wrapper .gfield_error .ginput_complex .ginput_left input[type=url], - body .gform_wrapper .gfield_error .ginput_complex .ginput_left input[type=email], - body .gform_wrapper .gfield_error .ginput_complex .ginput_left input[type=tel], - body .gform_wrapper .gfield_error .ginput_complex .ginput_left input[type=number], - body .gform_wrapper .gfield_error .ginput_complex .ginput_left input[type=password], - body .gform_wrapper .gfield_error .ginput_complex .ginput_right input[type=text], - body .gform_wrapper .gfield_error .ginput_complex .ginput_right input[type=url], - body .gform_wrapper .gfield_error .ginput_complex .ginput_right input[type=email], - body .gform_wrapper .gfield_error .ginput_complex .ginput_right input[type=tel], - body .gform_wrapper .gfield_error .ginput_complex .ginput_right input[type=number], - body .gform_wrapper .gfield_error .ginput_complex .ginput_right input[type=password], - body .gform_wrapper .gfield_error .ginput_complex .ginput_full input[type=text], - body .gform_wrapper .gfield_error .ginput_complex .ginput_full input[type=url], - body .gform_wrapper .gfield_error .ginput_complex .ginput_full input[type=email], - body .gform_wrapper .gfield_error .ginput_complex .ginput_full input[type=tel], - body .gform_wrapper .gfield_error .ginput_complex .ginput_full input[type=number], - body .gform_wrapper .gfield_error .ginput_complex .ginput_full input[type=password] { - width: 95% !important; - } - - body .gform_wrapper .ginput_complex span.name_suffix input[type=text] { - width: 97.5% !important; - } - - body .gform_wrapper .ginput_complex .ginput_right select, - body .gform_wrapper .ginput_complex .ginput_left select, - body .gform_wrapper .ginput_complex span.name_prefix.name_prefix_select select, - body .gform_wrapper .gfield_time_ampm select, - body .gform_wrapper .ginput_complex select, - body .gform_wrapper .ginput_complex .ginput_right select { - width: 97% !important; - } - - body .gform_wrapper .right_label .gfield_description, - body .gform_wrapper .left_label .gfield_description, - body .gform_wrapper .left_label .instruction, - body .gform_wrapper .right_label .instruction { - margin-left: 0 !important; - } - - body .gform_wrapper .gform_footer.right_label, - body .gform_wrapper .gform_footer.left_label { - padding-left: 0 !important; - padding-right: 0 !important; - } - - body .gform_wrapper .gfield_description, - body .gform_wrapper .gsection_description, - body .gform_wrapper .gfield_description p, - body .gform_wrapper .gsection_description p { - width: 95% !important; - text-align: justify; - } - - body .gform_wrapper label.gfield_label + div.ginput_container { - margin-top: 0; - } - - body .gform_wrapper .gfield .ginput_complex.has_suffix span.name_suffix { - width: 98% !important; - } - - body .gform_wrapper .gfield .ginput_complex.has_suffix span.name_suffix input { - width: 97.5%; - } - - body .gform_wrapper ul.gform_fields.left_label li.gfield label.gfield_label, - body .gform_wrapper ul.gform_fields.right_label li.gfield label.gfield_label { - margin-left: 0 !important; - float: none !important; - } - - body .gform_wrapper ul li.gfield.gfield_html img { - max-width: 95% !important; - } - - body .gform_wrapper .gform_footer a.gform_save_link { - display: block; - margin: 1em 0 1em 0; - text-align: center; - } - - body .gform_wrapper ul li.gfield.gfield_html h1, - body .gform_wrapper ul li.gfield.gfield_html h2, - body .gform_wrapper ul li.gfield.gfield_html h3, - body .gform_wrapper ul li.gfield.gfield_html h4, - body .gform_wrapper ul li.gfield.gfield_html h5, - body .gform_wrapper ul li.gfield.gfield_html h6 { - white-space: normal !important - } - - body .gform_wrapper .top_label .gfield_error { - width: 90% !important; - } - - body .form_saved_message { - font-size: 0.813em; - } - - body .form_saved_message_sent { - font-size: 0.813em; - } - - body .gform_wrapper div.validation_error { - font-size: 1em; - } - - body .form_saved_message .form_saved_message_emailform input, - body .form_saved_message .form_saved_message_emailform input[type=submit] { - width: 95% !important; - } - -} - -@media all and (max-device-width: 480px) { - - body .gform_wrapper { - font-size: inherit; - } - - body .gform_wrapper .gfield_checkbox li input[type=checkbox], - body .gform_wrapper .gfield_radio li input[type=radio], - body .gform_wrapper .gfield_checkbox li input { - margin-top: 2.50em !important; - width: auto !important; - height: auto !important; - } - } \ No newline at end of file diff --git a/css/readyclass.css b/css/readyclass.css index e992556..5e00738 100644 --- a/css/readyclass.css +++ b/css/readyclass.css @@ -4,7 +4,7 @@ readyclass.css Gravity Forms Ready Class Pre-Set Styles http://www.gravityforms.com -updated: January 28, 2015 1:27 PM +updated: February 17, 2015 12:29 PM Gravity Forms is a Rocketgenius project copyright 2008-2015 Rocketgenius Inc. @@ -26,341 +26,335 @@ to no. */ -@media (min-device-width: 481px) and (min-width: 481px) { +/* inline fields ready class ------------------------------------------------------*/ +.gform_wrapper .top_label li.gfield.gf_inline { + vertical-align: top; + width: auto !important; + margin-right: 0.875em; + float: none !important; + display: -moz-inline-stack; + display: inline-block; + zoom: 1; +} -/* inline fields ready class ------------------------------------------------------*/ +.gform_wrapper .top_label li.gfield.gf_inline input[type=text].large, +.gform_wrapper .top_label li.gfield.gf_inline input[type=url].large, +.gform_wrapper .top_label li.gfield.gf_inline input[type=email].large, +.gform_wrapper .top_label li.gfield.gf_inline input[type=tel].large, +.gform_wrapper .top_label li.gfield.gf_inline input[type=number].large, +.gform_wrapper .top_label li.gfield.gf_inline input[type=password].large { + width: 25.4em !important; +} + +.gform_wrapper .top_label li.gfield.gf_inline input[type=text].medium, +.gform_wrapper .top_label li.gfield.gf_inline input[type=url].medium, +.gform_wrapper .top_label li.gfield.gf_inline input[type=email].medium, +.gform_wrapper .top_label li.gfield.gf_inline input[type=tel].medium, +.gform_wrapper .top_label li.gfield.gf_inline input[type=number].medium, +.gform_wrapper .top_label li.gfield.gf_inline input[type=password].medium { + width: 18.7em !important; +} + +.gform_wrapper .top_label li.gfield.gf_inline input[type=text].datepicker.medium { + width: 6em !important; +} + +.gform_wrapper .top_label li.gfield.gf_inline input[type=text].small, +.gform_wrapper .top_label li.gfield.gf_inline input[type=url].small, +.gform_wrapper .top_label li.gfield.gf_inline input[type=email].small, +.gform_wrapper .top_label li.gfield.gf_inline input[type=tel].small, +.gform_wrapper .top_label li.gfield.gf_inline input[type=number].small, +.gform_wrapper .top_label li.gfield.gf_inline input[type=password].small { + width: 5em !important; +} + +.gform_wrapper .top_label li.gfield.gf_inline select { + width: auto !important; +} + +.gform_wrapper .top_label li.gfield.gf_inline textarea { + width: 95% !important; +} + +.gform_wrapper .top_label li.gfield.gf_inline div.gfield_time_hour input[type=text], +.gform_wrapper .top_label li.gfield.gf_inline div.gfield_time_minute input[type=text] { + width: 70% !important; +} + +.gform_wrapper .top_label li.gfield.gf_inline div.gfield_time_hour, +.gform_wrapper .top_label li.gfield.gf_inline div.gfield_time_minute, +.gform_wrapper .top_label li.gfield.gf_inline div.gfield_date_month, +.gform_wrapper .top_label li.gfield.gf_inline div.gfield_date_day, +.gform_wrapper .top_label li.gfield.gf_inline div.gfield_date_year { + width: 3.125em; +} + +.gform_wrapper .top_label li.gfield.gf_inline div.gfield_time_ampm { + width: auto; +} + +.gform_wrapper li.gf_inline div.ginput_container { + white-space: nowrap !important; +} + +/* 2 column ready class ------------------------------------------------------*/ + +.gform_wrapper .top_label li.gfield.gf_left_half { + margin: 0 0 0.50em 0; + width: 49%; +} + +.gform_wrapper .top_label li.gfield.gf_right_half { + margin: 0 0 0.50em 0; + width: 49%; +} + +.gform_wrapper .top_label li.gfield.gfield_error.gf_left_half, +.gform_wrapper .top_label li.gfield.gfield_error.gf_right_half { + width: 47.20%; +} + +.gform_wrapper .top_label li.gfield.gfield_error.gf_right_half { + margin-right: 1%; +} + +.gform_wrapper .top_label li.gfield.gf_left_half { + float: left; + clear: left !important; +} + +.gform_wrapper .top_label li.gfield.gf_right_half { + float: right; + clear: right !important; +} + +.gform_wrapper .top_label li.gfield.gf_left_half input.medium, +.gform_wrapper .top_label li.gfield.gf_left_half input.large, +.gform_wrapper .top_label li.gfield.gf_left_half select.medium, +.gform_wrapper .top_label li.gfield.gf_left_half select.large, +.gform_wrapper .top_label li.gfield.gf_right_half input.medium, +.gform_wrapper .top_label li.gfield.gf_right_half input.large, +.gform_wrapper .top_label li.gfield.gf_right_half select.medium, +.gform_wrapper .top_label li.gfield.gf_right_half select.large { + width: 97%; +} + +.gform_wrapper .top_label li.gfield.gf_left_half textarea, +.gform_wrapper .top_label li.gfield.gf_right_half textarea { + width: 98%; +} + +.gform_wrapper .top_label li.gfield.gf_left_half input.small, +.gform_wrapper .top_label li.gfield.gf_right_half input.small { + width: 35%; +} + +.gform_wrapper .top_label li.gfield.gf_left_half+li.gsection, +.gform_wrapper .top_label li.gfield.gf_right_half+li.gsection { + padding: 1em 0 0.50em 0; +} + +.gform_wrapper .top_label li.gfield.gf_left_half+li.gfield.gsection.gf_left_half, +.gform_wrapper .top_label li.gfield.gf_right_half+li.gfield.gsection.gf_left_half, +.gform_wrapper .top_label li.gfield.gf_left_half+li.gfield.gsection.gf_right_half, +.gform_wrapper .top_label li.gfield.gf_right_half+li.gfield.gsection.gf_right_half, +.gform_wrapper .top_label li.gfield.gsection.gf_left_half+li.gfield.gsection.gf_left_half, +.gform_wrapper .top_label li.gfield.gsection.gf_right_half+li.gfield.gsection.gf_left_half, +.gform_wrapper .top_label li.gfield.gsection.gf_right_half+li.gfield.gsection.gf_right_half { + padding: 1em 0 0.50em 0; +} + +.gform_wrapper .top_label li.gfield.gsection.gf_left_half+li.gfield.gsection.gf_right_half { + padding: 0 0 0.50em 0; +} + +.gform_wrapper .top_label li.gfield.gsection.gf_left_half+li.gfield.gsection.gf_right_half+li.gfield.gsection.gf_left_half+li.gfield.gsection.gf_right_half { + padding: 1em 0 0.50em 0; +} + +.gform_wrapper .top_label li.gfield.gf_left_half+li.gfield, +.gform_wrapper .top_label li.gfield.gf_right_half+li.gfield, +.gform_wrapper .top_label li.gfield.gf_left_half+.gform_footer, +.gform_wrapper .top_label li.gfield.gf_right_half+.gform_footer { + clear: both +} - .gform_wrapper .top_label li.gfield.gf_inline { - vertical-align: top; - width: auto !important; - margin-right: 0.875em; - float: none !important; - display: -moz-inline-stack; - display: inline-block; - zoom: 1; - } - - .gform_wrapper .top_label li.gfield.gf_inline input[type=text].large, - .gform_wrapper .top_label li.gfield.gf_inline input[type=url].large, - .gform_wrapper .top_label li.gfield.gf_inline input[type=email].large, - .gform_wrapper .top_label li.gfield.gf_inline input[type=tel].large, - .gform_wrapper .top_label li.gfield.gf_inline input[type=number].large, - .gform_wrapper .top_label li.gfield.gf_inline input[type=password].large { - width: 25.4em !important; - } - - .gform_wrapper .top_label li.gfield.gf_inline input[type=text].medium, - .gform_wrapper .top_label li.gfield.gf_inline input[type=url].medium, - .gform_wrapper .top_label li.gfield.gf_inline input[type=email].medium, - .gform_wrapper .top_label li.gfield.gf_inline input[type=tel].medium, - .gform_wrapper .top_label li.gfield.gf_inline input[type=number].medium, - .gform_wrapper .top_label li.gfield.gf_inline input[type=password].medium { - width: 18.7em !important; - } - - .gform_wrapper .top_label li.gfield.gf_inline input[type=text].datepicker.medium { - width: 6em !important; - } - - .gform_wrapper .top_label li.gfield.gf_inline input[type=text].small, - .gform_wrapper .top_label li.gfield.gf_inline input[type=url].small, - .gform_wrapper .top_label li.gfield.gf_inline input[type=email].small, - .gform_wrapper .top_label li.gfield.gf_inline input[type=tel].small, - .gform_wrapper .top_label li.gfield.gf_inline input[type=number].small, - .gform_wrapper .top_label li.gfield.gf_inline input[type=password].small { - width: 5em !important; - } - - .gform_wrapper .top_label li.gfield.gf_inline select { - width: auto !important; - } - - .gform_wrapper .top_label li.gfield.gf_inline textarea { - width: 95% !important; - } - - .gform_wrapper .top_label li.gfield.gf_inline div.gfield_time_hour input[type=text], - .gform_wrapper .top_label li.gfield.gf_inline div.gfield_time_minute input[type=text] { - width: 70% !important; - } - - .gform_wrapper .top_label li.gfield.gf_inline div.gfield_time_hour, - .gform_wrapper .top_label li.gfield.gf_inline div.gfield_time_minute, - .gform_wrapper .top_label li.gfield.gf_inline div.gfield_date_month, - .gform_wrapper .top_label li.gfield.gf_inline div.gfield_date_day, - .gform_wrapper .top_label li.gfield.gf_inline div.gfield_date_year { - width: 3.125em; - } - - .gform_wrapper .top_label li.gfield.gf_inline div.gfield_time_ampm { - width: auto; - } - - .gform_wrapper li.gf_inline div.ginput_container { - white-space: nowrap !important; - } - - /* 2 column ready class ------------------------------------------------------*/ - - .gform_wrapper .top_label li.gfield.gf_left_half { - margin: 0 0 0.50em 0; - width: 49%; - } - - .gform_wrapper .top_label li.gfield.gf_right_half { - margin: 0 0 0.50em 0; - width: 49%; - } - - .gform_wrapper .top_label li.gfield.gfield_error.gf_left_half, - .gform_wrapper .top_label li.gfield.gfield_error.gf_right_half { - width: 47.20%; - } - - .gform_wrapper .top_label li.gfield.gfield_error.gf_right_half { - margin-right: 1%; - } - - .gform_wrapper .top_label li.gfield.gf_left_half { - float: left; - clear: left !important; - } - - .gform_wrapper .top_label li.gfield.gf_right_half { - float: right; - clear: right !important; - } - - .gform_wrapper .top_label li.gfield.gf_left_half input.medium, - .gform_wrapper .top_label li.gfield.gf_left_half input.large, - .gform_wrapper .top_label li.gfield.gf_left_half select.medium, - .gform_wrapper .top_label li.gfield.gf_left_half select.large, - .gform_wrapper .top_label li.gfield.gf_right_half input.medium, - .gform_wrapper .top_label li.gfield.gf_right_half input.large, - .gform_wrapper .top_label li.gfield.gf_right_half select.medium, - .gform_wrapper .top_label li.gfield.gf_right_half select.large { - width: 97%; - } - - .gform_wrapper .top_label li.gfield.gf_left_half textarea, - .gform_wrapper .top_label li.gfield.gf_right_half textarea { - width: 98%; - } - - .gform_wrapper .top_label li.gfield.gf_left_half input.small, - .gform_wrapper .top_label li.gfield.gf_right_half input.small { - width: 35%; - } - - .gform_wrapper .top_label li.gfield.gf_left_half+li.gsection, - .gform_wrapper .top_label li.gfield.gf_right_half+li.gsection { - padding: 1em 0 0.50em 0; - } - - .gform_wrapper .top_label li.gfield.gf_left_half+li.gfield.gsection.gf_left_half, - .gform_wrapper .top_label li.gfield.gf_right_half+li.gfield.gsection.gf_left_half, - .gform_wrapper .top_label li.gfield.gf_left_half+li.gfield.gsection.gf_right_half, - .gform_wrapper .top_label li.gfield.gf_right_half+li.gfield.gsection.gf_right_half, - .gform_wrapper .top_label li.gfield.gsection.gf_left_half+li.gfield.gsection.gf_left_half, - .gform_wrapper .top_label li.gfield.gsection.gf_right_half+li.gfield.gsection.gf_left_half, - .gform_wrapper .top_label li.gfield.gsection.gf_right_half+li.gfield.gsection.gf_right_half { - padding: 1em 0 0.50em 0; - } - - .gform_wrapper .top_label li.gfield.gsection.gf_left_half+li.gfield.gsection.gf_right_half { - padding: 0 0 0.50em 0; - } - - .gform_wrapper .top_label li.gfield.gsection.gf_left_half+li.gfield.gsection.gf_right_half+li.gfield.gsection.gf_left_half+li.gfield.gsection.gf_right_half { - padding: 1em 0 0.50em 0; - } - - .gform_wrapper .top_label li.gfield.gf_left_half+li.gfield, - .gform_wrapper .top_label li.gfield.gf_right_half+li.gfield, - .gform_wrapper .top_label li.gfield.gf_left_half+.gform_footer, - .gform_wrapper .top_label li.gfield.gf_right_half+.gform_footer { - clear: both - } - - /* 3 column ready class ------------------------------------------------------*/ - - .gform_wrapper .top_label li.gfield.gf_left_third, - .gform_wrapper .top_label li.gfield.gf_middle_third, - .gform_wrapper .top_label li.gfield.gf_right_third { - margin: 0 0 0.50em 0; - width: 32%; - } - - .gform_wrapper .top_label li.gfield.gfield_error.gf_left_third, - .gform_wrapper .top_label li.gfield.gfield_error.gf_middle_third, - .gform_wrapper .top_label li.gfield.gfield_error.gf_right_third { - width: 29%; - } - - .gform_wrapper .top_label li.gfield.gfield_error.gf_right_third { - margin-right: 1%; - } - - .gform_wrapper .top_label li.gfield.gf_left_third { - float: left; - clear: left !important; - } - - .gform_wrapper .top_label li.gfield.gf_middle_third { - float: left; - margin-left: 2% !important; - clear: none !important; - } - - .gform_wrapper .top_label li.gfield.gfield_error.gf_middle_third { - margin-left: 3%; - } - - .gform_wrapper .top_label li.gfield.gf_right_third { - float: right; - clear: right !important; - } - - .gform_wrapper .top_label li.gfield.gf_left_third input.medium, - .gform_wrapper .top_label li.gfield.gf_left_third input.large, - .gform_wrapper .top_label li.gfield.gf_left_third select.medium, - .gform_wrapper .top_label li.gfield.gf_left_third select.large, - .gform_wrapper .top_label li.gfield.gf_middle_third input.medium, - .gform_wrapper .top_label li.gfield.gf_middle_third input.large, - .gform_wrapper .top_label li.gfield.gf_middle_third select.medium, - .gform_wrapper .top_label li.gfield.gf_middle_third select.large, - .gform_wrapper .top_label li.gfield.gf_right_third input.medium, - .gform_wrapper .top_label li.gfield.gf_right_third input.large, - .gform_wrapper .top_label li.gfield.gf_right_third select.medium, - .gform_wrapper .top_label li.gfield.gf_right_third select.large { - width: 95%; - } - - .gform_wrapper .top_label li.gfield.gf_left_third+li.gsection, - .gform_wrapper .top_label li.gfield.gf_right_third+li.gsection { - padding: 1em 0 0.50em 0; - } - - .gform_wrapper .top_label li.gfield.gf_left_third+li.gfield, - .gform_wrapper .top_label li.gfield.gf_middle_third+li.gfield, - .gform_wrapper .top_label li.gfield.gf_right_third+li.gfield, - .gform_wrapper .top_label li.gfield.gf_left_third+.gform_footer, - .gform_wrapper .top_label li.gfield.gf_middle_third+.gform_footer, - .gform_wrapper .top_label li.gfield.gf_right_third+.gform_footer { - clear: both; - } - - /* radio/checkbox sub-column ready classes ------------------------------------------------------*/ - - .gform_wrapper li.gfield.gf_list_2col ul.gfield_checkbox li, - .gform_wrapper li.gfield.gf_list_2col ul.gfield_radio li, - .gform_wrapper li.gfield.gf_2col ul.gfield_checkbox li, - .gform_wrapper li.gfield.gf_2col ul.gfield_radio li { - width: 50%; - float: left; - margin: 0 0 0.50em 0; - min-height: 1.8em; - } - - .gform_wrapper li.gfield.gf_list_3col ul.gfield_checkbox li, - .gform_wrapper li.gfield.gf_list_3col ul.gfield_radio li, - .gform_wrapper li.gfield.gf_3col ul.gfield_checkbox li, - .gform_wrapper li.gfield.gf_3col ul.gfield_radio li { - width: 33%; - float: left; - margin: 0 0 0.50em 0; - min-height: 1.8em; - } - - .gform_wrapper li.gfield.gf_list_4col ul.gfield_checkbox li, - .gform_wrapper li.gfield.gf_list_4col ul.gfield_radio li { - width: 25%; - float: left; - margin: 0 0 0.5em 0; - min-height: 1.8em; - } - - .gform_wrapper li.gfield.gf_list_5col ul.gfield_checkbox li, - .gform_wrapper li.gfield.gf_list_5col ul.gfield_radio li { - width: 20%; - float: left; - margin: 0 0 0.50em 0; - min-height: 1.8em; - } - - .gform_wrapper li.gfield.gf_list_2col ul.gfield_checkbox, - .gform_wrapper li.gfield.gf_list_2col ul.gfield_radio, - .gform_wrapper li.gfield.gf_list_3col ul.gfield_checkbox, - .gform_wrapper li.gfield.gf_list_3col ul.gfield_radio, - .gform_wrapper li.gfield.gf_list_4col ul.gfield_checkbox, - .gform_wrapper li.gfield.gf_list_4col ul.gfield_radio, - .gform_wrapper li.gfield.gf_list_5col ul.gfield_checkbox, - .gform_wrapper li.gfield.gf_list_5col ul.gfield_radio, - .gform_wrapper li.gfield.gf_2col ul.gfield_checkbox, - .gform_wrapper li.gfield.gf_2col ul.gfield_radio, - .gform_wrapper li.gfield.gf_3col ul.gfield_checkbox, - .gform_wrapper li.gfield.gf_3col ul.gfield_radio { - overflow: hidden; - } - - .gform_wrapper li.gfield.gf_list_2col label.gfield_label, - .gform_wrapper li.gfield.gf_list_3col label.gfield_label, - .gform_wrapper li.gfield.gf_list_4col label.gfield_label, - .gform_wrapper li.gfield.gf_list_5col label.gfield_label, - .gform_wrapper li.gfield.gf_list_inline label.gfield_label { - margin: 0.625em 0 0.625em 0; - } - - /* optional height settings for the radio/checkbox columns */ - - .gform_wrapper li.gfield.gf_list_height_25 ul.gfield_checkbox li, - .gform_wrapper li.gfield.gf_list_height_25 ul.gfield_radio li { - height: 25px; - } - - .gform_wrapper li.gfield.gf_list_height_50 ul.gfield_checkbox li, - .gform_wrapper li.gfield.gf_list_height_50 ul.gfield_radio li { - height: 50px; - } - - .gform_wrapper li.gfield.gf_list_height_75 ul.gfield_checkbox li, - .gform_wrapper li.gfield.gf_list_height_75 ul.gfield_radio li { - height: 75px; - } - - .gform_wrapper li.gfield.gf_list_height_100 ul.gfield_checkbox li, - .gform_wrapper li.gfield.gf_list_height_100 ul.gfield_radio li { - height: 100px; - } - - .gform_wrapper li.gfield.gf_list_height_125 ul.gfield_checkbox li, - .gform_wrapper li.gfield.gf_list_height_125 ul.gfield_radio li { - height: 125px; - } - .gform_wrapper li.gfield.gf_list_height_150 ul.gfield_checkbox li, - .gform_wrapper li.gfield.gf_list_height_150 ul.gfield_radio li { - height: 150px; - } - - /* radio/checkbox inline list ready classes ------------------------------------------------------*/ - - .gform_wrapper li.gf_list_inline ul.gfield_checkbox li, - .gform_wrapper li.gf_list_inline ul.gfield_radio li { - width: auto !important; - float: none !important; - margin: 0 0.625em 0.625em 0; - display: -moz-inline-stack; - display: inline-block; - zoom: 1; - } - - body.gform_wrapper .top_label li.gsection.gf_scroll_text { - width: 92.5% !important; - } - - - } +/* 3 column ready class ------------------------------------------------------*/ + +.gform_wrapper .top_label li.gfield.gf_left_third, +.gform_wrapper .top_label li.gfield.gf_middle_third, +.gform_wrapper .top_label li.gfield.gf_right_third { + margin: 0 0 0.50em 0; + width: 32%; +} + +.gform_wrapper .top_label li.gfield.gfield_error.gf_left_third, +.gform_wrapper .top_label li.gfield.gfield_error.gf_middle_third, +.gform_wrapper .top_label li.gfield.gfield_error.gf_right_third { + width: 29%; +} + +.gform_wrapper .top_label li.gfield.gfield_error.gf_right_third { + margin-right: 1%; +} + +.gform_wrapper .top_label li.gfield.gf_left_third { + float: left; + clear: left !important; +} + +.gform_wrapper .top_label li.gfield.gf_middle_third { + float: left; + margin-left: 2% !important; + clear: none !important; +} + +.gform_wrapper .top_label li.gfield.gfield_error.gf_middle_third { + margin-left: 3%; +} + +.gform_wrapper .top_label li.gfield.gf_right_third { + float: right; + clear: right !important; +} + +.gform_wrapper .top_label li.gfield.gf_left_third input.medium, +.gform_wrapper .top_label li.gfield.gf_left_third input.large, +.gform_wrapper .top_label li.gfield.gf_left_third select.medium, +.gform_wrapper .top_label li.gfield.gf_left_third select.large, +.gform_wrapper .top_label li.gfield.gf_middle_third input.medium, +.gform_wrapper .top_label li.gfield.gf_middle_third input.large, +.gform_wrapper .top_label li.gfield.gf_middle_third select.medium, +.gform_wrapper .top_label li.gfield.gf_middle_third select.large, +.gform_wrapper .top_label li.gfield.gf_right_third input.medium, +.gform_wrapper .top_label li.gfield.gf_right_third input.large, +.gform_wrapper .top_label li.gfield.gf_right_third select.medium, +.gform_wrapper .top_label li.gfield.gf_right_third select.large { + width: 95%; +} + +.gform_wrapper .top_label li.gfield.gf_left_third+li.gsection, +.gform_wrapper .top_label li.gfield.gf_right_third+li.gsection { + padding: 1em 0 0.50em 0; +} + +.gform_wrapper .top_label li.gfield.gf_left_third+li.gfield, +.gform_wrapper .top_label li.gfield.gf_middle_third+li.gfield, +.gform_wrapper .top_label li.gfield.gf_right_third+li.gfield, +.gform_wrapper .top_label li.gfield.gf_left_third+.gform_footer, +.gform_wrapper .top_label li.gfield.gf_middle_third+.gform_footer, +.gform_wrapper .top_label li.gfield.gf_right_third+.gform_footer { + clear: both; +} + +/* radio/checkbox sub-column ready classes ------------------------------------------------------*/ + +.gform_wrapper li.gfield.gf_list_2col ul.gfield_checkbox li, +.gform_wrapper li.gfield.gf_list_2col ul.gfield_radio li, +.gform_wrapper li.gfield.gf_2col ul.gfield_checkbox li, +.gform_wrapper li.gfield.gf_2col ul.gfield_radio li { + width: 50%; + float: left; + margin: 0 0 0.50em 0; + min-height: 1.8em; +} + +.gform_wrapper li.gfield.gf_list_3col ul.gfield_checkbox li, +.gform_wrapper li.gfield.gf_list_3col ul.gfield_radio li, +.gform_wrapper li.gfield.gf_3col ul.gfield_checkbox li, +.gform_wrapper li.gfield.gf_3col ul.gfield_radio li { + width: 33%; + float: left; + margin: 0 0 0.50em 0; + min-height: 1.8em; +} + +.gform_wrapper li.gfield.gf_list_4col ul.gfield_checkbox li, +.gform_wrapper li.gfield.gf_list_4col ul.gfield_radio li { + width: 25%; + float: left; + margin: 0 0 0.5em 0; + min-height: 1.8em; +} + +.gform_wrapper li.gfield.gf_list_5col ul.gfield_checkbox li, +.gform_wrapper li.gfield.gf_list_5col ul.gfield_radio li { + width: 20%; + float: left; + margin: 0 0 0.50em 0; + min-height: 1.8em; +} + +.gform_wrapper li.gfield.gf_list_2col ul.gfield_checkbox, +.gform_wrapper li.gfield.gf_list_2col ul.gfield_radio, +.gform_wrapper li.gfield.gf_list_3col ul.gfield_checkbox, +.gform_wrapper li.gfield.gf_list_3col ul.gfield_radio, +.gform_wrapper li.gfield.gf_list_4col ul.gfield_checkbox, +.gform_wrapper li.gfield.gf_list_4col ul.gfield_radio, +.gform_wrapper li.gfield.gf_list_5col ul.gfield_checkbox, +.gform_wrapper li.gfield.gf_list_5col ul.gfield_radio, +.gform_wrapper li.gfield.gf_2col ul.gfield_checkbox, +.gform_wrapper li.gfield.gf_2col ul.gfield_radio, +.gform_wrapper li.gfield.gf_3col ul.gfield_checkbox, +.gform_wrapper li.gfield.gf_3col ul.gfield_radio { + overflow: hidden; +} + +.gform_wrapper li.gfield.gf_list_2col label.gfield_label, +.gform_wrapper li.gfield.gf_list_3col label.gfield_label, +.gform_wrapper li.gfield.gf_list_4col label.gfield_label, +.gform_wrapper li.gfield.gf_list_5col label.gfield_label, +.gform_wrapper li.gfield.gf_list_inline label.gfield_label { + margin: 0.625em 0 0.625em 0; +} + +/* optional height settings for the radio/checkbox columns */ + +.gform_wrapper li.gfield.gf_list_height_25 ul.gfield_checkbox li, +.gform_wrapper li.gfield.gf_list_height_25 ul.gfield_radio li { + height: 25px; +} + +.gform_wrapper li.gfield.gf_list_height_50 ul.gfield_checkbox li, +.gform_wrapper li.gfield.gf_list_height_50 ul.gfield_radio li { + height: 50px; +} + +.gform_wrapper li.gfield.gf_list_height_75 ul.gfield_checkbox li, +.gform_wrapper li.gfield.gf_list_height_75 ul.gfield_radio li { + height: 75px; +} + +.gform_wrapper li.gfield.gf_list_height_100 ul.gfield_checkbox li, +.gform_wrapper li.gfield.gf_list_height_100 ul.gfield_radio li { + height: 100px; +} + +.gform_wrapper li.gfield.gf_list_height_125 ul.gfield_checkbox li, +.gform_wrapper li.gfield.gf_list_height_125 ul.gfield_radio li { + height: 125px; +} +.gform_wrapper li.gfield.gf_list_height_150 ul.gfield_checkbox li, +.gform_wrapper li.gfield.gf_list_height_150 ul.gfield_radio li { + height: 150px; +} + +/* radio/checkbox inline list ready classes ------------------------------------------------------*/ + +.gform_wrapper li.gf_list_inline ul.gfield_checkbox li, +.gform_wrapper li.gf_list_inline ul.gfield_radio li { + width: auto !important; + float: none !important; + margin: 0 0.625em 0.625em 0; + display: -moz-inline-stack; + display: inline-block; + zoom: 1; +} + +body.gform_wrapper .top_label li.gsection.gf_scroll_text { + width: 92.5% !important; +} /* hide am/pm field ready class ------------------------------------------------------*/ diff --git a/entry_detail.php b/entry_detail.php index 07d28f9..67e4e56 100644 --- a/entry_detail.php +++ b/entry_detail.php @@ -517,7 +517,7 @@ function toggleNotificationOverride(isInit) {
diff --git a/entry_list.php b/entry_list.php index c1ae72b..eff0fd1 100644 --- a/entry_list.php +++ b/entry_list.php @@ -770,15 +770,15 @@ function initSelectAllEntries() {
  • - + () |
  • - + () |
  • - + () |
  • @@ -882,7 +884,7 @@ function initSelectAllEntries() { ?>

    diff --git a/form_detail.php b/form_detail.php index 7e4abba..d7cb765 100644 --- a/form_detail.php +++ b/form_detail.php @@ -734,24 +734,25 @@ function IsValidFormula(formula) { type != 'quantity' ? $choice['value'] . '|' . GFCommon::to_number( rgar( $choice, 'price' ) ): $choice['value']; + $price = GFCommon::to_number( rgar( $choice, 'price' ) ) == false ? 0 : GFCommon::to_number( rgar( $choice, 'price' ) ); + $val = $is_pricing_field && $field->type != 'quantity' ? $choice['value'] . '|' . $price: $choice['value']; $default_values[ $field->id ] = $val; } else if ( rgar( $choice, 'isSelected' ) ) { if ( ! isset( $default_values[ $field->id ] ) ) { diff --git a/form_list.php b/form_list.php index 2ec5926..730a565 100644 --- a/form_list.php +++ b/form_list.php @@ -296,15 +296,15 @@ function gfConfirmBulkAction(element_id) {
    • - + () |
    • - + () |
    • - + () |
    • diff --git a/forms_model.php b/forms_model.php index 55dcd7a..38796fd 100644 --- a/forms_model.php +++ b/forms_model.php @@ -1560,7 +1560,7 @@ public static function refresh_product_cache( $form, $lead, $use_choice_text = f * * @param array $form Form object. * @param GF_Field $field Field object. - * @param array $field_values Default field values for this form. Used when form has not yet been submitted. Pass an array if no default field values are avilable/required. + * @param array $field_values Default field values for this form. Used when form has not yet been submitted. Pass an array if no default field values are available/required. * @param array $lead Optional, default is null. If lead object is available, pass the lead. * * @return mixed @@ -4324,7 +4324,23 @@ private static function get_field_filters_where( $form_id, $search_criteria ) { } } - $search_term_format = rgar( $search, 'is_numeric' ) || $is_number_field ? '%f' : '%s'; + $search_term_placeholder = rgar( $search, 'is_numeric' ) || $is_number_field ? '%f' : '%s'; + + if ( is_array( $search_term ) ) { + if ( in_array( $operator, array( '=', 'in' ) ) ) { + $operator = 'IN'; // Override operator + // Format in SQL and sanitize the strings in the list + $search_terms = array_fill( 0, count( $search_term ), '%s' ); + $search_term_placeholder = $wpdb->prepare( '( ' . implode( ', ', $search_terms ) . ' )', $search_term ); + $search_term = ''; // Set to blank, still gets passed to wpdb::prepare below but isn't used + } elseif ( in_array( $operator, array( '!=', '<>', 'not in' ) ) ) { + $operator = 'NOT IN'; // Override operator + // Format in SQL and sanitize the strings in the list + $search_terms = array_fill( 0, count( $search_term ), '%s' ); + $search_term_placeholder = $wpdb->prepare( '( ' . implode( ', ', $search_terms ) . ' )', $search_term ); + $search_term = ''; // Set to blank, still gets passed to wpdb::prepare below but isn't used + } + } $upper_field_number_limit = (string) (int) $key === $key ? (float) $key + 0.9999 : (float) $key + 0.0001; /* doesn't support "<>" for checkboxes */ @@ -4335,7 +4351,7 @@ private static function get_field_filters_where( $form_id, $search_criteria ) { SELECT lead_id from {$lead_details_table_name} - WHERE (field_number BETWEEN %s AND %s AND value {$operator} {$search_term_format}) + WHERE (field_number BETWEEN %s AND %s AND value {$operator} {$search_term_placeholder}) {$form_id_where} )", (float) $key - 0.0001, $upper_field_number_limit, $search_term ); @@ -4797,7 +4813,7 @@ function gform_get_meta( $entry_id, $meta_key ) { $table_name = RGFormsModel::get_lead_meta_table_name(); $results = $wpdb->get_results( $wpdb->prepare( "SELECT meta_value FROM {$table_name} WHERE lead_id=%d AND meta_key=%s", $entry_id, $meta_key ) ); $value = isset( $results[0] ) ? $results[0]->meta_value : null; - $meta_value = $value == null ? false : maybe_unserialize( $value ); + $meta_value = $value === null ? false : maybe_unserialize( $value ); $_gform_lead_meta[ $cache_key ] = $meta_value; return $meta_value; @@ -4811,8 +4827,6 @@ function gform_get_meta_values_for_entries( $entry_ids, $meta_keys ) { } $table_name = RGFormsModel::get_lead_meta_table_name(); - $meta_value_array = array(); - $select_meta_keys = join( ',', $meta_keys ); $meta_key_select_array = array(); foreach ( $meta_keys as $meta_key ) { @@ -4833,7 +4847,7 @@ function gform_get_meta_values_for_entries( $entry_ids, $meta_keys ) { foreach ( $results as $result ) { foreach ( $meta_keys as $meta_key ) { - $result->$meta_key = $result->$meta_key == null ? false : maybe_unserialize( $result->$meta_key ); + $result->$meta_key = $result->$meta_key === null ? false : maybe_unserialize( $result->$meta_key ); } } diff --git a/gravityforms.php b/gravityforms.php index 4c6b031..4604cfe 100644 --- a/gravityforms.php +++ b/gravityforms.php @@ -3,7 +3,7 @@ Plugin Name: Gravity Forms Plugin URI: http://www.gravityforms.com Description: Easily create web forms and manage form entries within the WordPress admin. -Version: 1.9.1.6 +Version: 1.9.2 Author: rocketgenius Author URI: http://www.rocketgenius.com Text Domain: gravityforms @@ -112,7 +112,7 @@ class GFForms { - public static $version = '1.9.1.5'; + public static $version = '1.9.2'; public static function loaded() { @@ -381,6 +381,8 @@ public static function setup( $force_setup = false ) { self::add_security_files(); + self::do_self_healing(); + //The format the version info changed to JSON. Make sure the old format is not cached. if ( version_compare( get_option( 'rg_form_version' ), '1.8.0.3', '<' ) ) { delete_transient( 'gform_update_info' ); @@ -569,17 +571,90 @@ public static function setup_database() { } - public static function add_security_files(){ + public static function add_security_files() { $upload_root = GFFormsModel::get_upload_root(); - if ( ! is_dir( $upload_root ) ) { - return; - } + if ( ! is_dir( $upload_root ) ) { + return; + } + + self::do_self_healing(); GFCommon::recursive_add_index_file( $upload_root ); GFCommon::add_htaccess_file(); + } + + private static function do_self_healing() { + $flag_security_alert = self::heal_wp_upload_dir(); + + $gf_upload_root = GFFormsModel::get_upload_root(); + + if ( ! is_dir( $gf_upload_root ) ) { + return; + } + + $flag_security_alert = self::rename_suspicious_files_recursive( $gf_upload_root, $flag_security_alert ); + if ( $flag_security_alert ) { + update_option( 'gform_security_alert', $flag_security_alert ); + } + } + + /** + * Renames files with a .bak extension if they have a file extension that is not allowed in the Gravity Forms uploads folder. + */ + private static function rename_suspicious_files_recursive( $dir, $flag_security_alert = false ) { + if ( ! is_dir( $dir ) ) { + return; + } + + if ( ! ( $dir_handle = opendir( $dir ) ) ) { + return; + } + + // ignores all errors + set_error_handler( create_function( '', 'return 0;' ), E_ALL ); + + while ( false !== ( $file = readdir( $dir_handle ) ) ) { + if ( is_dir( $dir . DIRECTORY_SEPARATOR . $file ) && $file != '.' && $file != '..' ) { + $flag_security_alert = self::rename_suspicious_files_recursive( $dir . DIRECTORY_SEPARATOR . $file, $flag_security_alert ); + } elseif ( GFCommon::file_name_has_disallowed_extension( $file ) + && ! GFCommon::match_file_extension( $file, array( 'htaccess', 'bak' ) ) ) { + $mini_hash = substr( wp_hash( $file ), 0, 6 ); + $newName = sprintf( '%s/%s.%s.bak', $dir, $file, $mini_hash ); + rename( $dir . '/' . $file, $newName ); + $flag_security_alert = true; + } + } + + closedir( $dir_handle ); + + return $flag_security_alert; + } + + private static function heal_wp_upload_dir(){ + $wp_upload_dir = wp_upload_dir(); + + $wp_upload_path = $wp_upload_dir['basedir']; + + if ( ! is_dir( $wp_upload_path ) ) { + return; + } + + $flag_security_alert = false; + + // ignores all errors + set_error_handler( create_function( '', 'return 0;' ), E_ALL ); + + foreach ( glob( $wp_upload_path . DIRECTORY_SEPARATOR . '*_input_*.{php,php5}', GLOB_BRACE ) as $filename ) { + $mini_hash = substr( wp_hash( $filename ), 0, 6 ); + $newName = sprintf( '%s.%s.bak', $filename, $mini_hash ); + rename( $filename, $newName ); + $flag_security_alert = true; + } + + return $flag_security_alert; } private static function fix_leading_and_trailing_spaces() { @@ -1505,7 +1580,7 @@ public static function register_scripts() { wp_register_script( 'gform_forms', $base_url . '/js/forms.js', array( 'jquery' ), $version ); wp_register_script( 'gform_gravityforms', $base_url . "/js/gravityforms{$min}.js", array( 'jquery', 'gform_json' ), $version ); wp_register_script( 'gform_json', $base_url . '/js/jquery.json-1.3.js', array( 'jquery' ), $version, true ); - wp_register_script( 'gform_masked_input', $base_url . '/js/jquery.maskedinput-1.3.1.min.js', array( 'jquery' ), $version ); + wp_register_script( 'gform_masked_input', $base_url . '/js/jquery.maskedinput.min.js', array( 'jquery' ), $version ); wp_register_script( 'gform_menu', $base_url . '/js/menu.js', array( 'jquery' ), $version ); wp_register_script( 'gform_placeholder', $base_url . '/js/placeholders.jquery.min.js', array( 'jquery' ), $version ); wp_register_script( 'gform_tooltip_init', $base_url . '/js/tooltip_init.js', array( 'jquery-ui-tooltip' ), $version ); @@ -1673,19 +1748,23 @@ public static function enqueue_admin_scripts( $hook ) { } - if ( in_array( $hook, array( 'post.php', 'post-new.php' ) ) ) { - //add_filter( 'gform_shortcode_preview_disabled', '__return_false' ); - require_once( GFCommon::get_base_path() . '/tooltips.php' ); - wp_enqueue_script( 'gform_shortcode_ui' ); - wp_enqueue_style( 'gform_shortcode_ui' ); - wp_localize_script( 'gform_shortcode_ui', 'gfShortcodeUIData', array( - 'shortcodes' => self::get_shortcodes(), - 'previewNonce' => wp_create_nonce( 'gf-shortcode-ui-preview' ), - 'previewDisabled' => apply_filters( 'gform_shortcode_preview_disabled', true ), - 'strings' => array( - 'pleaseSelectAForm' => __( 'Please select a form.', 'gravityforms' ), - ) - ) ); + + if ( self::page_supports_add_form_button() ) { + // add_filter( 'gform_shortcode_preview_disabled', '__return_false' ); + $screen = get_current_screen(); + if ( ! $screen instanceof WP_Screen || $screen->post_type != 'attachment' ) { + require_once( GFCommon::get_base_path() . '/tooltips.php' ); + wp_enqueue_script( 'gform_shortcode_ui' ); + wp_enqueue_style( 'gform_shortcode_ui' ); + wp_localize_script( 'gform_shortcode_ui', 'gfShortcodeUIData', array( + 'shortcodes' => self::get_shortcodes(), + 'previewNonce' => wp_create_nonce( 'gf-shortcode-ui-preview' ), + 'previewDisabled' => apply_filters( 'gform_shortcode_preview_disabled', true ), + 'strings' => array( + 'pleaseSelectAForm' => __( 'Please select a form.', 'gravityforms' ), + ) + ) ); + } } if ( empty( $scripts ) ) { @@ -1989,7 +2068,7 @@ public static function forms() { } public static function get( $name, $array = null ) { - if ( ! $array ) { + if ( ! isset( $array ) ) { $array = $_GET; } @@ -2000,9 +2079,10 @@ public static function get( $name, $array = null ) { return ''; } - public static function post( $name ) { + public static function post( $name, $do_stripslashes = true ) { + if ( isset( $_POST[ $name ] ) ) { - return $_POST[ $name ]; + return $do_stripslashes ? stripslashes_deep( $_POST[ $name ] ) : $_POST[ $name ]; } return ''; @@ -3029,4 +3109,4 @@ function rgexplode( $sep, $string, $count ) { return $ary; } -} \ No newline at end of file +} diff --git a/includes/addon/class-gf-addon.php b/includes/addon/class-gf-addon.php index 65b74ca..cb909ca 100644 --- a/includes/addon/class-gf-addon.php +++ b/includes/addon/class-gf-addon.php @@ -1171,12 +1171,12 @@ protected function get_mapped_field_value( $setting_name, $form, $entry, $settin } protected function get_full_address( $entry, $field_id ) { - $street_value = str_replace( ' ', ' ', trim( $entry[ $field_id . '.1' ] ) ); - $street2_value = str_replace( ' ', ' ', trim( $entry[ $field_id . '.2' ] ) ); - $city_value = str_replace( ' ', ' ', trim( $entry[ $field_id . '.3' ] ) ); - $state_value = str_replace( ' ', ' ', trim( $entry[ $field_id . '.4' ] ) ); - $zip_value = trim( $entry[ $field_id . '.5' ] ); - $country_value = GFCommon::get_country_code( trim( $entry[ $field_id . '.6' ] ) ); + $street_value = str_replace( ' ', ' ', trim( rgar( $entry, $field_id . '.1' ) ) ); + $street2_value = str_replace( ' ', ' ', trim( rgar( $entry, $field_id . '.2' ) ) ); + $city_value = str_replace( ' ', ' ', trim( rgar( $entry, $field_id . '.3' ) ) ); + $state_value = str_replace( ' ', ' ', trim( rgar( $entry, $field_id . '.4' ) ) ); + $zip_value = trim( rgar( $entry, $field_id . '.5' ) ); + $country_value = GF_Fields::get( 'address' )->get_country_code( trim( rgar( $entry, $field_id . '.6' ) ) ); $address = $street_value; $address .= ! empty( $address ) && ! empty( $street2_value ) ? " $street2_value" : $street2_value; @@ -1191,7 +1191,7 @@ protected function get_full_address( $entry, $field_id ) { protected function get_full_name( $entry, $field_id ) { - //If field is aweber (one input), simply return full content + //If field is simple (one input), simply return full content $name = rgar( $entry, $field_id ); if ( ! empty( $name ) ) return $name; @@ -1199,13 +1199,15 @@ protected function get_full_name( $entry, $field_id ) { //Complex field (multiple inputs). Join all pieces and create name $prefix = trim( rgar( $entry, $field_id . '.2' ) ); $first = trim( rgar( $entry, $field_id . '.3' ) ); + $middle = trim( rgar( $entry, $field_id . '.4' ) ); $last = trim( rgar( $entry, $field_id . '.6' ) ); $suffix = trim( rgar( $entry, $field_id . '.8' ) ); $name = $prefix; - $name .= ! empty( $name ) && ! empty( $first ) ? " $first" : $first; - $name .= ! empty( $name ) && ! empty( $last ) ? " $last" : $last; - $name .= ! empty( $name ) && ! empty( $suffix ) ? " $suffix" : $suffix; + $name .= ! empty( $name ) && ! empty( $first ) ? ' ' . $first : $first; + $name .= ! empty( $name ) && ! empty( $middle ) ? ' ' . $middle : $middle; + $name .= ! empty( $name ) && ! empty( $last ) ? ' ' . $last : $last; + $name .= ! empty( $name ) && ! empty( $suffix ) ? ' ' . $suffix : $suffix; return $name; } @@ -1702,34 +1704,38 @@ public static function get_field_map_choices( $form_id ) { // Populate form fields if ( is_array( $form['fields'] ) ) { foreach ( $form['fields'] as $field ) { - if ( is_array( rgar( $field, 'inputs' ) ) ) { - + $inputs = $field->get_entry_inputs(); + if ( is_array( $inputs ) ) { //If this is an address field, add full name to the list if ( RGFormsModel::get_input_type( $field ) == 'address' ) { - $fields[] = array( 'value' => $field['id'], 'label' => GFCommon::get_label( $field ) . ' (' . __( 'Full', 'gravityforms' ) . ')' ); + $fields[] = array( + 'value' => $field->id, + 'label' => GFCommon::get_label( $field ) . ' (' . __( 'Full', 'gravityforms' ) . ')' + ); } //If this is a name field, add full name to the list - if ( RGFormsModel::get_input_type( $field ) == 'name' ){ - $fields[] = array( 'value' => $field['id'], 'label' => GFCommon::get_label( $field ) . ' (' . __( 'Full', 'gravityforms' ) . ')' ); + if ( RGFormsModel::get_input_type( $field ) == 'name' ) { + $fields[] = array( + 'value' => $field->id, + 'label' => GFCommon::get_label( $field ) . ' (' . __( 'Full', 'gravityforms' ) . ')' + ); } //If this is a checkbox field, add to the list if ( RGFormsModel::get_input_type( $field ) == 'checkbox' ) { - $fields[] = array( 'value' => $field['id'], 'label' => GFCommon::get_label( $field ) . ' (' . __( 'Selected', 'gravityforms' ) . ')' ); + $fields[] = array( + 'value' => $field->id, + 'label' => GFCommon::get_label( $field ) . ' (' . __( 'Selected', 'gravityforms' ) . ')' + ); } - foreach ( $field['inputs'] as $input ) { - if( RGFormsModel::get_input_type( $field ) == 'creditcard' ) { - //only include the credit card type (field_id.4) and number (field_id.1) - if ( $input['id'] == $field['id'] . '.1' || $input['id'] == $field['id'] . '.4' ) { - $fields[] = array( 'value' => $input['id'], 'label' => GFCommon::get_label( $field, $input['id'] ) ); - } - } - else { - $fields[] = array( 'value' => $input['id'], 'label' => GFCommon::get_label( $field, $input['id'] ) ); - } + + foreach ( $inputs as $input ) { + $fields[] = array( + 'value' => $input['id'], + 'label' => GFCommon::get_label( $field, $input['id'] ) + ); } - } - else if ( ! rgar( $field, 'displayOnly' ) ) { - $fields[] = array( 'value' => $field['id'], 'label' => GFCommon::get_label( $field ) ); + } elseif ( ! rgar( $field, 'displayOnly' ) ) { + $fields[] = array( 'value' => $field->id, 'label' => GFCommon::get_label( $field ) ); } } } @@ -1849,8 +1855,9 @@ public function get_form_fields_as_choices( $form, $args = array() ) { $fields = array(); - if ( ! is_array( $form['fields'] ) ) + if ( ! is_array( $form['fields'] ) ) { return $fields; + } $args = wp_parse_args( $args, array( @@ -1863,30 +1870,42 @@ public function get_form_fields_as_choices( $form, $args = array() ) { $input_type = GFFormsModel::get_input_type( $field ); - if ( ! empty( $args['input_types'] ) && ! in_array( $input_type, $args['input_types'] ) ) + if ( ! empty( $args['input_types'] ) && ! in_array( $input_type, $args['input_types'] ) ) { continue; + } - if ( is_array( rgar( $field, 'inputs' ) ) ) { - + $inputs = $field->get_entry_inputs(); + if ( is_array( $inputs ) ) { // if this is an address field, add full name to the list - if ( $input_type == 'address' ) - $fields[] = array( 'value' => $field['id'], 'label' => GFCommon::get_label( $field ) . ' (' . __( 'Full', 'gravityforms' ) . ')' ); - + if ( $input_type == 'address' ) { + $fields[] = array( + 'value' => $field->id, + 'label' => GFCommon::get_label( $field ) . ' (' . __( 'Full', 'gravityforms' ) . ')' + ); + } // if this is a name field, add full name to the list - if ( $input_type == 'name' ) - $fields[] = array( 'value' => $field['id'], 'label' => GFCommon::get_label( $field ) . ' (' . __( 'Full', 'gravityforms' ) . ')' ); - + if ( $input_type == 'name' ) { + $fields[] = array( + 'value' => $field->id, + 'label' => GFCommon::get_label( $field ) . ' (' . __( 'Full', 'gravityforms' ) . ')' + ); + } // if this is a checkbox field, add to the list - if ( $input_type == 'checkbox' ) - $fields[] = array( 'value' => $field['id'], 'label' => GFCommon::get_label( $field ) . ' (' . __( 'Selected', 'gravityforms' ) . ')' ); - - foreach ( $field['inputs'] as $input ) { - $fields[] = array( 'value' => $input['id'], 'label' => GFCommon::get_label( $field, $input['id'] ) ); + if ( $input_type == 'checkbox' ) { + $fields[] = array( + 'value' => $field->id, + 'label' => GFCommon::get_label( $field ) . ' (' . __( 'Selected', 'gravityforms' ) . ')' + ); } - } else if ( ! rgar( $field, 'displayOnly' ) ) { - - $fields[] = array( 'value' => $field['id'], 'label' => GFCommon::get_label( $field ) ); + foreach ( $inputs as $input ) { + $fields[] = array( + 'value' => $input['id'], + 'label' => GFCommon::get_label( $field, $input['id'] ) + ); + } + } elseif ( ! rgar( $field, 'displayOnly' ) ) { + $fields[] = array( 'value' => $field->id, 'label' => GFCommon::get_label( $field ) ); } } diff --git a/includes/addon/class-gf-payment-addon.php b/includes/addon/class-gf-payment-addon.php index 91bf180..e6a9088 100644 --- a/includes/addon/class-gf-payment-addon.php +++ b/includes/addon/class-gf-payment-addon.php @@ -1067,7 +1067,7 @@ protected function setup_cron() { add_action( $cron_name, array( $this, 'check_status' ) ); if ( ! wp_next_scheduled( $cron_name ) ) { - wp_schedule_event( time(), 'daily', $cron_name ); + wp_schedule_event( time(), 'hourly', $cron_name ); } @@ -1904,7 +1904,7 @@ public function results_filter_ui( $filter_ui, $form_id, $page_title, $gf_page, $payment_method_markup = "
      +
      "; $day_field = "
      - +
      "; $year_field = "
      - +
      "; } else { $month_field = "
      - +
      "; $day_field = "
      - +
      "; $year_field = "
      - +
      "; } - $month_dropdown = "
      " . $this->get_month_dropdown( '', "{$field_id}_1", rgar( $date_info, 'month' ), '', "disabled='disabled'", $month_placeholder_value ) . '
      '; - $day_dropdown = "
      " . $this->get_day_dropdown( '', "{$field_id}_2", rgar( $date_info, 'day' ), '', "disabled='disabled'", $day_placeholder_value ) . '
      '; - $year_dropdown = "
      " . $this->get_year_dropdown( '', "{$field_id}_3", rgar( $date_info, 'year' ), '', "disabled='disabled'", $year_placeholder_value, $form ) . '
      '; + $month_dropdown = "
      " . $this->get_month_dropdown( '', "{$field_id}_1", rgar( $date_info, 'month' ), '', $disabled_text, $month_placeholder_value ) . '
      '; + $day_dropdown = "
      " . $this->get_day_dropdown( '', "{$field_id}_2", rgar( $date_info, 'day' ), '', $disabled_text, $day_placeholder_value ) . '
      '; + $year_dropdown = "
      " . $this->get_year_dropdown( '', "{$field_id}_3", rgar( $date_info, 'year' ), '', $disabled_text, $year_placeholder_value, $form ) . '
      '; - $field_string = "
      "; + $field_string = "
      "; switch ( $field_position ) { case 'dmy' : diff --git a/includes/fields/class-gf-field-email.php b/includes/fields/class-gf-field-email.php index 9e862cf..ca2584d 100644 --- a/includes/fields/class-gf-field-email.php +++ b/includes/fields/class-gf-field-email.php @@ -43,10 +43,12 @@ public function get_entry_inputs() { public function validate( $value, $form ) { $email = is_array( $value ) ? rgar( $value, 0 ) : $value; // Form objects created in 1.8 will supply a string as the value. - if ( ! rgblank( $value ) && ! GFCommon::is_valid_email( $email ) ) { + $is_blank = rgblank( $value ) || ( is_array( $value ) && rgempty( array_filter( $value ) ) ); + + if ( ! $is_blank && ! GFCommon::is_valid_email( $email ) ) { $this->failed_validation = true; $this->validation_message = empty( $this->errorMessage ) ? __( 'Please enter a valid email address.', 'gravityforms' ) : $this->errorMessage; - }elseif ( $this->emailConfirmEnabled && ! empty( $email ) ) { + } elseif ( $this->emailConfirmEnabled && ! empty( $email ) ) { $confirm = is_array( $value ) ? rgar( $value, 1 ) : rgpost( 'input_' . $this->id . '_2' ); if ( $confirm != $email ) { $this->failed_validation = true; diff --git a/includes/fields/class-gf-field-fileupload.php b/includes/fields/class-gf-field-fileupload.php index 660724b..7f98e7f 100644 --- a/includes/fields/class-gf-field-fileupload.php +++ b/includes/fields/class-gf-field-fileupload.php @@ -268,10 +268,10 @@ public function is_value_submission_empty( $form_id ) { } public function get_value_save_entry( $value, $form, $input_name, $lead_id, $lead ) { - return $this->multipleFiles ? $this->get_multifile_value($form['id'], $input_name) : $this->get_single_file_value( $form['id'], $input_name ); + return $this->multipleFiles ? $this->get_multifile_value( $form['id'], $input_name, $value ) : $this->get_single_file_value( $form['id'], $input_name ); } - public function get_multifile_value($form_id, $input_name){ + public function get_multifile_value( $form_id, $input_name, $value ) { global $_gf_uploaded_files; GFCommon::log_debug( __METHOD__ . '(): Starting.' ); @@ -345,6 +345,7 @@ public function upload_file( $form_id, $file ) { } if ( move_uploaded_file( $file['tmp_name'], $target['path'] ) ) { + GFCommon::log_debug( __METHOD__ . '(): File successfully moved.' ); $this->set_permissions( $target['path'] ); return $target['url']; diff --git a/includes/fields/class-gf-field-name.php b/includes/fields/class-gf-field-name.php index 5bf1c33..661dc8b 100644 --- a/includes/fields/class-gf-field-name.php +++ b/includes/fields/class-gf-field-name.php @@ -287,18 +287,37 @@ public function get_css_class() { if ( $prefix_input && ! rgar( $prefix_input, 'isHidden' ) ) { $css_class .= 'has_prefix '; } + else { + $css_class .= 'no_prefix '; + } + if ( $first_input && ! rgar( $first_input, 'isHidden' ) ) { $css_class .= 'has_first_name '; } + else { + $css_class .= 'no_first_name '; + } + if ( $middle_input && ! rgar( $middle_input, 'isHidden' ) ) { $css_class .= 'has_middle_name '; } + else { + $css_class .= 'no_middle_name '; + } + if ( $last_input && ! rgar( $last_input, 'isHidden' ) ) { $css_class .= 'has_last_name '; } + else { + $css_class .= 'no_last_name '; + } + if ( $suffix_input && ! rgar( $suffix_input, 'isHidden' ) ) { $css_class .= 'has_suffix '; } + else { + $css_class .= 'no_suffix '; + } return trim( $css_class ); } diff --git a/includes/fields/class-gf-field-password.php b/includes/fields/class-gf-field-password.php index a5e62ab..11f2bd5 100644 --- a/includes/fields/class-gf-field-password.php +++ b/includes/fields/class-gf-field-password.php @@ -40,8 +40,8 @@ public function get_entry_inputs() { } public function validate( $value, $form ) { - $password = $_POST[ 'input_' . $this->id ]; - $confirm = $_POST[ 'input_' . $this->id . '_2' ]; + $password = rgpost( 'input_' . $this->id ); + $confirm = rgpost( 'input_' . $this->id . '_2' ); if ( $password != $confirm ) { $this->failed_validation = true; $this->validation_message = __( 'Your passwords do not match.', 'gravityforms' ); @@ -93,7 +93,7 @@ public function get_field_input( $form, $value = '', $entry = null ) { $onchange = $this->passwordStrengthEnabled ? "onchange='{$action}'" : ''; $onkeyup = $this->passwordStrengthEnabled ? "onkeyup='{$action}'" : ''; - $confirmation_value = RGForms::post( 'input_' . $id . '_2' ); + $confirmation_value = rgpost( 'input_' . $id . '_2' ); $password_value = is_array( $value ) ? $value[0] : $value; $password_value = esc_attr( $password_value ); diff --git a/includes/fields/class-gf-field-post-tags.php b/includes/fields/class-gf-field-post-tags.php index e661577..7fdb1dd 100644 --- a/includes/fields/class-gf-field-post-tags.php +++ b/includes/fields/class-gf-field-post-tags.php @@ -23,6 +23,7 @@ function get_form_editor_field_settings() { 'admin_label_setting', 'size_setting', 'rules_setting', + 'default_value_setting', 'visibility_setting', 'description_setting', 'css_class_setting', diff --git a/includes/upload.php b/includes/upload.php index 7d283bc..2bd16a4 100644 --- a/includes/upload.php +++ b/includes/upload.php @@ -20,14 +20,17 @@ class GFAsyncUpload { public static function upload() { GFCommon::log_debug( 'GFAsyncUpload::upload(): Starting.' ); + + if ( $_SERVER['REQUEST_METHOD'] != 'POST' ) { + status_header( 404 ); + die(); + } + header( 'Content-Type: text/html; charset=' . get_option( 'blog_charset' ) ); send_nosniff_header(); nocache_headers(); - status_header( 200 ); - if( $_SERVER['REQUEST_METHOD'] != 'POST'){ - die(); - } + status_header( 200 ); // If the file is bigger than the server can accept then the form_id might not arrive. // This might happen if the file is bigger than the max post size ini setting. @@ -37,11 +40,11 @@ public static function upload() { die( '{"status" : "error", "error" : {"code": 500, "message": "' . __( 'Failed to upload file.', 'gravityforms' ) . '"}}' ); } - $form_id = intval($_REQUEST['form_id']); + $form_id = intval( $_REQUEST['form_id'] ); $form_unique_id = rgpost( 'gform_unique_id' ); $form = GFFormsModel::get_form_meta( $form_id ); - if ( empty( $form ) || ! ctype_alnum($form_unique_id) ) { + if ( empty( $form ) || ! ctype_alnum( $form_unique_id ) ) { die(); } @@ -85,7 +88,7 @@ public static function upload() { $field_id = rgpost( 'field_id' ); $field = GFFormsModel::get_field( $form, $field_id ); - if ( empty( $field ) || $field->type != 'fileupload') { + if ( empty( $field ) || GFFormsModel::get_input_type( $field ) != 'fileupload') { die(); } diff --git a/includes/webapi/webapi.php b/includes/webapi/webapi.php index 677ed52..0686d66 100644 --- a/includes/webapi/webapi.php +++ b/includes/webapi/webapi.php @@ -133,7 +133,7 @@ public function styles() { ), ); - return array_merge( parent::scripts(), $styles ); + return array_merge( parent::styles(), $styles ); } public function render_uninstall() { @@ -266,8 +266,8 @@ public function settings_developer_tools() { - / + /