Skip to content

Commit

Permalink
Merge branch 'release/2.2.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
remcotolsma committed Jun 9, 2017
2 parents 7f5d8d8 + 6f717f3 commit 2799807
Show file tree
Hide file tree
Showing 65 changed files with 898 additions and 618 deletions.
42 changes: 39 additions & 3 deletions change_log.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,46 @@
------------------------------------------------------------------------------------------------------------------
Version 2.2.1.2
- Fixed an issue with license validation request that can prevent license key validation.
Version 2.2.3
- Added security enhancements. Credit: Gennady Kovshenin.
- Added support for Mastercard 2-series number.
- Fixed an issue which could prevent the gravityhelp.com support forms being successfully submitted when including the System Report from some sites.
- Fixed an issue with the ID attribute of the accepted file types message container when multiple File Upload fields are present on the page.
- Fixed an issue where a new field could be assigned the same id as a field to be deleted resulting in the new field being lost when the original field is deleted on save.
- Fixed an issue with File Upload field URLs in text format notifications containing escaped ampersands.
- Fixed missing confirmation message anchor for AJAX enabled single page forms.
- Fixed an issue where the urls of deleted files could remain in the multi-file enabled upload field entry value when editing the entry, if a new file was added at the same time.
- AF: Added "description" settings field property to display description below settings field.
- AF: Added "no_choices" select settings field property to display message when no choice are available for field.
- API: Fixed a database error in gform_get_meta_values_for_entries() when searching for meta keys with special characters e.g. hyphens.

------------------------------------------------------------------------------------------------------------------
Version 2.2.1.1
Version 2.2.2
- Added 'gform_multifile_upload_field' filter to allow field object to be filtered.
- Added 'gform_duplicate_field' javascript filter to allow duplicated field to be changed.
- Added the 'gform_html_message_template_pre_send_email' filter allowing the html formatted notification message to be overridden.
- Updated delivery of files requested for download to prevent third-parties to corrupt the file content.
- Updated the System Report.
- Fixed issues with the Copy System Report button and the form switcher drop down when no-conflict mode is enabled.
- Fixed issue with special characters when defining a new choice group in the bulk editor popup.
- Fixed a PHP warning and fatal error related to the Forms toolbar menu.
- Fixed the extremely outdated version message remaining after updating to the latest version.
- Fixed 'undefined' appearing as a header in the bulk add / predefined choices modal.
- Fixed the Members plugin integration which was missing the System Status page capability (gravityforms_system_status).
- Fixed styling issue with Entry Updated message.
- Fixed the minimum width of the form switcher drop down when all the forms have titles which are only a few characters in length.
- Fixed a potential conflict with other plugins that load modified versions of the WP_Background_Process class.
- Fixed an issue where dynamic population of a field may fail when the value passed in the query string is 0.
- Fixed a PHP notice when using the gf-download file link if the output buffer is not set.
- Fixed currently selected multi-select field choices not being selected when editing an entry.
- Fixed an issue with the confirmation message markup for AJAX enabled forms containing an extra gforms_confirmation_message div.
- Fixed the Forms dashboard widget including trashed forms.
- Fixed a PHP fatal error which occurred on the global settings page of the installation wizard when the entry point was the Forms > Add-Ons page.
- Fixed an issue with the submission time evaluation of conditional logic rules using the contains operator when the rule value is 0.
- Fixed an inconsistency between the front-end and validation character counts for the Paragraph field.
- Fixed a fatal error which could occur when checking if the logging add-on is active in some environments.
- Fixed an issue with license validation request that can prevent license key validation.
- Fixed a PHP notice on the System Status page with PHP versions older than 5.4.
- AF: Fixed a PHP fatal error which could occur with add-ons using the field_map type setting with PHP versions older than 5.3.
- AF: Fixed an issue preventing feeds from being processed in the background.

------------------------------------------------------------------------------------------------------------------
Version 2.2.1
Expand Down
72 changes: 57 additions & 15 deletions common.php
Original file line number Diff line number Diff line change
Expand Up @@ -2332,6 +2332,14 @@ public static function is_product_field( $field_type ) {
return in_array( $field_type, $product_fields );
}

/**
* Returns all the plugin capabilities.
*
* @since 2.2.1.12 Added gravityforms_system_status.
* @since unknown
*
* @return array
*/
public static function all_caps() {
return array(
'gravityforms_edit_forms',
Expand All @@ -2349,6 +2357,7 @@ public static function all_caps() {
'gravityforms_view_updates',
'gravityforms_view_addons',
'gravityforms_preview_forms',
'gravityforms_system_status',
);
}

Expand Down Expand Up @@ -2486,7 +2495,7 @@ public static function get_remote_post_params() {
'slug' => $slug,
'version' => $plugin['Version'],
'is_active' => $is_active,
);
);
}
$plugins = json_encode( $plugins );

Expand Down Expand Up @@ -2611,15 +2620,15 @@ public static function cache_remote_message() {
public static function post_to_manager( $file, $query, $options ) {

$request_url = GRAVITY_MANAGER_URL . '/' . $file . '?' . $query;
self::log_debug( 'Posting to manager: ' . $request_url );
self::log_debug( __METHOD__ . '(): endpoint: ' . $request_url );
$raw_response = wp_remote_post( $request_url, $options );
self::log_debug( print_r( $raw_response, true ) );
self::log_remote_response( $raw_response );

if ( is_wp_error( $raw_response ) || 200 != $raw_response['response']['code'] ) {
self::log_error( 'Error from manager. Sending to proxy...' );
self::log_error( __METHOD__ . '(): Error from manager. Sending to proxy...' );
$request_url = GRAVITY_MANAGER_PROXY_URL . '/proxy.php?f=' . $file . '&' . $query;
$raw_response = wp_remote_post( $request_url, $options );
self::log_debug( print_r( $raw_response, true ) );
self::log_remote_response( $raw_response );
}

return $raw_response;
Expand Down Expand Up @@ -3845,7 +3854,7 @@ public static function get_card_types() {
'name' => 'MasterCard',
'slug' => 'mastercard',
'lengths' => '16',
'prefixes' => '51,52,53,54,55',
'prefixes' => '51,52,53,54,55,22,23,24,25,26,270,271,272',
'checksum' => true,
),
array(
Expand Down Expand Up @@ -3971,9 +3980,12 @@ public static function is_wp_version( $min_version ) {
*
* @return bool If the logging plugin is active.
*/
public static function is_logging_plugin_active(){
public static function is_logging_plugin_active() {
if ( ! function_exists( 'is_plugin_active' ) ) {
require_once ABSPATH . 'wp-admin/includes/plugin.php';
}

//In some scenarios, is_plugin_active() will return true when plugin file has been manually deleted.
// In some scenarios, is_plugin_active() will return true when plugin file has been manually deleted.
return is_plugin_active( 'gravityformslogging/logging.php' ) && file_exists( trailingslashit( WP_PLUGIN_DIR ) . 'gravityformslogging/logging.php' );

}
Expand Down Expand Up @@ -4259,6 +4271,21 @@ public static function log_debug( $message ) {
}
}

/**
* Log the remote request response.
*
* @since 2.2.2.1
*
* @param WP_Error|array $response The remote request response or WP_Error on failure.
*/
public static function log_remote_response( $response ) {
if ( is_wp_error( $response ) || isset( $_GET['gform_debug'] ) ) {
self::log_error( __METHOD__ . '(): ' . print_r( $response, 1 ) );
} else {
self::log_debug( sprintf( '%s(): code: %s; body: %s', __METHOD__, wp_remote_retrieve_response_code( $response ), wp_remote_retrieve_body( $response ) ) );
}
}

public static function echo_if( $condition, $text ) {
_deprecated_function( 'GFCommon::echo_if() is deprecated', '1.9.9', 'Use checked() or selected() instead.' );

Expand Down Expand Up @@ -4362,8 +4389,8 @@ public static function gf_vars( $echo = true ) {
$gf_vars['removeFieldFilter'] = esc_html__( 'Remove a condition', 'gravityforms' );
$gf_vars['filterAndAny'] = esc_html__( 'Include results if {0} match:', 'gravityforms' );

$gf_vars['customChoices'] = esc_html__( 'Custom Choices', 'gravityforms' );

$gf_vars['customChoices'] = esc_html__( 'Custom Choices', 'gravityforms' );
$gf_vars['predefinedChoices'] = esc_html__( 'Predefined Choices', 'gravityforms' );

if ( is_admin() && rgget( 'id' ) ) {

Expand Down Expand Up @@ -5503,23 +5530,38 @@ private static function format_text_message( $message ) {
}

/**
* @param $message
* @param $subject
* Maybe wrap the notification message in html tags.
*
* @since 2.2.0
*
* @param string $message The notification message. Merge tags have already been processed.
* @param string $subject The notification subject line. Merge tags have already been processed.
*
* @return string
*/
private static function format_html_message( $message, $subject ) {
if ( ! preg_match( '/<html/i', $message ) ) {
$message =
$template =
"<html>
<head>
<title>{$subject}</title>
<title>{subject}</title>
</head>
<body>
{$message}
{message}
</body>
</html>";

/**
* Allow the template for the html formatted message to be overridden.
*
* @since 2.2.1.5
*
* @param string $template The template for the html formatted message. Use {message} and {subject} as placeholders.
*/
$template = apply_filters( 'gform_html_message_template_pre_send_email', $template );

$message = str_replace( '{message}', $message, $template );
$message = str_replace( '{subject}', $subject, $message );
}

return $message;
Expand Down
66 changes: 52 additions & 14 deletions css/admin.css
Original file line number Diff line number Diff line change
Expand Up @@ -138,29 +138,66 @@ div.gf_delete_notice {
margin-bottom: 10px;
}

div.gforms_help_alert {
div.gforms_help_alert,
div.gforms_red_alert,
div.gforms_green_alert {
background-color: #fff;
border-left: 4px solid #ffba00;
box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.1);
display: inline-block;
font-family: "lucida sans","lucida grande",lucida,sans-serif;
font-size: 12px;
line-height: 1.6;
margin: 12px 24px -6px;
padding: 11px 15px;
position: relative;
text-align: left;
box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.1);
display: inline-block;
font-family: "lucida sans","lucida grande",lucida,sans-serif;
font-size: 12px;
line-height: 1.6;
margin: 12px 24px -6px;
padding: 11px 15px;
position: relative;
text-align: left;
}

/* yellow alert style */

div.gforms_help_alert {
border-left: 4px solid #FFBA00;
}

html[dir="rtl"] div.gforms_help_alert {
border-right: 4px solid #ffba00;
border-left: none !important;
border-right: 4px solid #FFBA00;
border-left: none !important;
}

div.gforms_help_alert i.fa {
color: #D4662C;
}

/* red alert style */

div.gforms_red_alert {
border-left: 4px solid #DD3D36;
}

html[dir="rtl"] div.gforms_red_alert {
border-right: 4px solid #DD3D36;
border-left: none !important;
}

div.gforms_red_alert i.fa {
color: #DD3D36;
}

/* green alert style */

div.gforms_green_alert {
border-left: 4px solid #7AD03A;
}

html[dir="rtl"] div.gforms_green_alert {
border-right: 4px solid #7AD03A;
border-left: none !important;
}

div.gforms_green_alert i.fa {
color: #7AD03A;
}

div.gforms_helpbox {
background-color: #fff;
margin: 10px 0;
Expand Down Expand Up @@ -2675,7 +2712,8 @@ ul#gf_form_toolbar_links li.gf_form_toolbar_results a.gf_toolbar_disabled:hover
}

#form_switcher{
max-width : 300px;
max-width: 300px;
min-width: 130px;
}

.form_switcher_arrow i{
Expand Down
2 changes: 1 addition & 1 deletion css/admin.min.css

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions entry_detail.php
Original file line number Diff line number Diff line change
Expand Up @@ -659,8 +659,8 @@ function toggleNotificationOverride(isInit) {

if ( rgpost( 'action' ) == 'update' ) {
?>
<div class="updated fade" style="padding:6px;">
<?php esc_html_e( 'Entry Updated.', 'gravityforms' ); ?>
<div class="updated fade">
<p><?php esc_html_e( 'Entry Updated.', 'gravityforms' ); ?></p>
</div>
<?php
}
Expand Down
Loading

0 comments on commit 2799807

Please sign in to comment.