Skip to content

Commit

Permalink
Merge branch 'develop' into feature/3199
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh Pollock authored May 22, 2019
2 parents c021a40 + ee30d69 commit 52649d5
Show file tree
Hide file tree
Showing 21 changed files with 1,008 additions and 371 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,5 @@ wp-test-case

#https://getcomposer.org/doc/faqs/should-i-commit-the-dependencies-in-my-vendor-directory.md
/vendor/**/.git

!assets/build/
12 changes: 9 additions & 3 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ module.exports = function (grunt) {
'!.env',
'!db-error.php',
'!webpack.config.js',
'!docker-compose.yml'
'!docker-compose.yml',
'!wp-content/**',
'!wordpress/**'
];

//Include webpacked clients
Expand Down Expand Up @@ -287,7 +289,7 @@ module.exports = function (grunt) {


exec: {
composerDist: 'composer clearcache && composer update --prefer-dist --no-dev --optimize-autoloader --ignore-platform-reqs'
composerDist: 'composer clearcache && rm -rf vendor && composer update --prefer-dist --no-dev --optimize-autoloader --ignore-platform-reqs'
}

});
Expand All @@ -307,7 +309,11 @@ module.exports = function (grunt) {

grunt.registerTask( 'version_number', [ 'replace' ] );
grunt.registerTask( 'build', [ 'version_number', 'default', 'make' ] );
grunt.registerTask( 'make', [ 'exec:composerDist', 'mkdir:build', 'copy:build' ] );
grunt.registerTask( 'make', [
// 'exec:composerDist',
'mkdir:build',
'copy:build'
] );



Expand Down
3 changes: 2 additions & 1 deletion assets/build/css/caldera-forms-front.min.css

Large diffs are not rendered by default.

59 changes: 59 additions & 0 deletions assets/build/css/fields.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/css/caldera-forms-front.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/js/caldera-forms-front.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! GENERATED SOURCE FILE caldera-forms - v1.8.3 - 2019-03-26 */var resBaldrickTriggers;
/*! GENERATED SOURCE FILE caldera-forms - v1.8.5-b.1 - 2019-04-19 */var resBaldrickTriggers;

jQuery(function($){
function fieldErrors(fields, $form, $notice) {
Expand Down
2 changes: 1 addition & 1 deletion assets/js/entry-viewer-2.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! GENERATED SOURCE FILE caldera-forms - v1.8.3 - 2019-03-26 *//**
/*! GENERATED SOURCE FILE caldera-forms - v1.8.5-b.1 - 2019-04-19 *//**
* API Client for Caldera Forms API for a single form
*
* @since 1.5.0
Expand Down
2 changes: 1 addition & 1 deletion assets/js/parsley.min.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! GENERATED SOURCE FILE caldera-forms - v1.8.3 - 2019-03-26 *//*!
/*! GENERATED SOURCE FILE caldera-forms - v1.8.5-b.1 - 2019-04-19 *//*!
* Parsley.js
* Version 2.8.1 - built Sat, Feb 3rd 2018, 2:27 pm
* http://parsleyjs.org
Expand Down
2 changes: 1 addition & 1 deletion assets/js/state/state.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ function CFState(formId, $ ){
}

if (calcVals.hasOwnProperty(id) ) {
if( false === calcVals[id] || null === calcVals[id] ){
if( false === calcVals[id] || null === calcVals[id] || 0 === calcVals[id] ){
//@TODO use let here, when ES6.
var _val = findCalcVal( $( document.getElementById( id ) ) );
if( isString( _val ) ) {
Expand Down
2 changes: 1 addition & 1 deletion assets/js/vue.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! GENERATED SOURCE FILE caldera-forms - v1.8.3 - 2019-03-26 *//*!
/*! GENERATED SOURCE FILE caldera-forms - v1.8.5-b.1 - 2019-04-19 *//*!
* Vue.js v2.1.6
* (c) 2014-2016 Evan You
* Released under the MIT License.
Expand Down
4 changes: 2 additions & 2 deletions caldera-core.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Plugin URI: https://CalderaForms.com
Description: Easy to use, grid based responsive form builder for creating simple to complex forms.
Author: Caldera Labs
Version: 1.8.4
Version: 1.8.5-b.1
Author URI: http://CalderaLabs.org
Text Domain: caldera-forms
GitHub Plugin URI: https://github.com/CalderaWP/caldera-forms
Expand Down Expand Up @@ -54,7 +54,7 @@ function caldera_forms_wp_version_nag()
} else {
define('CFCORE_PATH', plugin_dir_path(__FILE__));
define('CFCORE_URL', plugin_dir_url(__FILE__));
define( 'CFCORE_VER', '1.8.4' );
define( 'CFCORE_VER', '1.8.5-b.1' );
define('CFCORE_EXTEND_URL', 'https://api.calderaforms.com/1.0/');
define('CFCORE_BASENAME', plugin_basename(__FILE__));

Expand Down
4 changes: 3 additions & 1 deletion classes/core.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@
* Caldera_Forms Plugin class.
* @package Caldera_Forms
* @author David Cramer <[email protected]>
*
*
*/

class Caldera_Forms
{

Expand All @@ -23,7 +26,6 @@ class Caldera_Forms
*/
const VERSION = CFCORE_VER;

/**
/**
* @since 1.4.2
*/
Expand Down
79 changes: 46 additions & 33 deletions classes/email/filters.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,42 +41,55 @@ public static function mail_attachment_check( $mail, $data, $form){
}
continue;
}
if ( isset( $data[ $field_id ] ) ) {
$file = $data[ $field_id ];
} else {
$file = Caldera_Forms::get_field_data( $field_id, $form );
}
if ( is_array( $file ) ) {
foreach ( $file as $a_file ) {
$file = str_replace( $dir[ 'baseurl' ], $dir[ 'basedir' ], $file );
if ( is_string( $a_file ) && file_exists( $a_file ) ) {
$mail[ 'attachments' ][] = $a_file;
}
}
continue;
} else {
$file = str_replace( $dir[ 'baseurl' ], $dir[ 'basedir' ], $file );
if ( is_string( $file ) ) {
$files = explode(',', $file);
foreach($files as $attachment){
$attachment = ltrim( $attachment, " ");
if( file_exists($attachment) ){
$mail[ 'attachments' ][] = $attachment;

if( Caldera_Forms_Field_Util::is_cf2_field_type(Caldera_Forms_Field_Util::get_type($field,$form))){
$file = Caldera_Forms::get_field_data( $field_id, $form );
if ( is_array( $file ) ) {
foreach ( $file as $a_file ) {
$a_file = str_replace( $dir[ 'baseurl' ], $dir[ 'basedir' ], $a_file );
if ( is_string( $a_file ) && file_exists( $a_file ) ) {
$mail[ 'attachments' ][] = $a_file;
}
}
continue;
}
}else{
if ( isset( $data[ $field_id ] ) ) {
$file = $data[ $field_id ];
} else {
$file = Caldera_Forms::get_field_data( $field_id, $form );
}
if ( is_array( $file ) ) {
foreach ( $file as $a_file ) {
$file = str_replace( $dir[ 'baseurl' ], $dir[ 'basedir' ], $file );
if ( is_string( $a_file ) && file_exists( $a_file ) ) {
$mail[ 'attachments' ][] = $a_file;
}
}
continue;
} else {
$file = str_replace( $dir[ 'baseurl' ], $dir[ 'basedir' ], $file );
if ( is_string( $file ) ) {
$files = explode(',', $file);
foreach($files as $attachment){
$attachment = ltrim( $attachment, " ");
if( file_exists($attachment) ){
$mail[ 'attachments' ][] = $attachment;
}
}
} else {
if ( isset( $data[ $field_id ] ) && filter_var( $data[ $field_id ], FILTER_VALIDATE_URL ) ) {
$mail[ 'attachments' ][] = $data[ $field_id ];
} elseif ( isset( $_POST[ $field_id ] ) && filter_var( $_POST[ $field_id ], FILTER_VALIDATE_URL ) && 0 === strpos( $_POST[ $field_id ], $dir[ 'url' ] ) ) {
$mail[ 'attachments' ][] = $_POST[ $field_id ];
} else {
continue;
}
}
}
}
}


} else {
if ( isset( $data[ $field_id ] ) && filter_var( $data[ $field_id ], FILTER_VALIDATE_URL ) ) {
$mail[ 'attachments' ][] = $data[ $field_id ];
} elseif ( isset( $_POST[ $field_id ] ) && filter_var( $_POST[ $field_id ], FILTER_VALIDATE_URL ) && 0 === strpos( $_POST[ $field_id ], $dir[ 'url' ] ) ) {
$mail[ 'attachments' ][] = $_POST[ $field_id ];
} else {
continue;
}
}
}
}
}
return $mail;
}
Expand Down
7 changes: 6 additions & 1 deletion classes/magic.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,12 @@ public function field_magic( $_value, $value, $matches, $entry_id, $form ){

if( ! empty( $matches ) && ! empty( $matches[1] ) && ! empty( $matches[1][0]) ){

if ( Caldera_Forms_Field_Util::has_field_type( 'credit_card_exp', $form ) ) {
//Set default $form value to be an empty array (prevents option labels that use magic tags to break entry viewer)
if ( $form === null ){
$form = array();
}

if ( Caldera_Forms_Field_Util::has_field_type( 'credit_card_exp', $form ) ) {
$split = Caldera_Forms_Magic_Util::split_tags( $matches[1][0] );
if( is_array( $split ) && ! empty( $split[1] ) && in_array( $split[1], array( 'month', 'year' ) ) ){
$field = Caldera_Forms_Field_Util::get_field_by_slug( $split[0], $form );
Expand Down
15 changes: 0 additions & 15 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,6 @@
"role": "Contributing Developer"
}
],
"repositories": [
{
"type": "git",
"url": "https://github.com/CalderaWP/caldera-interop"
},
{
"type": "git",
"url": "https://github.com/CalderaWP/caldera-ghost-runner"
},
{
"type":"composer",
"url":"https://wpackagist.org"
}
],
"homepage": "http://calderaforms.com",
"require": {
"php": ">=5.6.0",
Expand Down Expand Up @@ -94,5 +80,4 @@
"*": "dist"
}
}

}
Loading

0 comments on commit 52649d5

Please sign in to comment.