Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion classes/helpers/FrmAppHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,7 @@ public static function is_admin() {
* @return bool
*/
public static function is_empty_value( $value, $empty = '' ) {
return ( is_array( $value ) && empty( $value ) ) || $value === $empty;
return $value === array() || $value === $empty;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion classes/models/FrmEntryMeta.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ public static function update_entry_metas( $entry_id, $values ) {

if ( $previous_field_ids && in_array( $field_id, $previous_field_ids ) ) {

if ( ( is_array( $meta_value ) && empty( $meta_value ) ) || ( ! is_array( $meta_value ) && trim( $meta_value ) === '' ) ) {
if ( $meta_value === array() || ( ! is_array( $meta_value ) && trim( $meta_value ) === '' ) ) {
// Remove blank fields.
unset( $values_indexed_by_field_id[ $field_id ] );
} else {
Expand Down
3 changes: 0 additions & 3 deletions rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

// CodeQuality
use Rector\CodeQuality\Rector\Assign\CombinedAssignRector;
use Rector\CodeQuality\Rector\BooleanAnd\SimplifyEmptyArrayCheckRector;
use Rector\CodeQuality\Rector\Class_\CompleteDynamicPropertiesRector;
use Rector\CodeQuality\Rector\Class_\InlineConstructorDefaultToPropertyRector;
use Rector\CodeQuality\Rector\ClassMethod\LocallyCalledStaticMethodToNonStaticRector;
Expand Down Expand Up @@ -149,8 +148,6 @@
JoinStringConcatRector::class,
LocallyCalledStaticMethodToNonStaticRector::class,
ShortenElseIfRector::class,
// This changes if is_array() && empty() to if === [].
SimplifyEmptyArrayCheckRector::class,
SimplifyEmptyCheckOnEmptyArrayRector::class,
SimplifyRegexPatternRector::class,
SingleInArrayToCompareRector::class,
Expand Down
Loading