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
9 changes: 8 additions & 1 deletion classes/helpers/FrmAppHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -1378,7 +1378,14 @@ public static function icon_by_class( $class, $atts = array() ) {
$icon_classes = array();
$is_font_icon = true;

foreach ( preg_split( '/\s+/', $class, -1, PREG_SPLIT_NO_EMPTY ) as $single_class ) {
$single_classes = preg_split( '/\s+/', $class, -1, PREG_SPLIT_NO_EMPTY );

if ( ! $single_classes ) {
// preg_split returns false if $class is not a string.
$single_classes = array();
}

foreach ( $single_classes as $single_class ) {
if ( 'frmfont' === $single_class || 'frm_icon_font' === $single_class ) {
$is_font_icon = false;
continue;
Expand Down
8 changes: 8 additions & 0 deletions tests/phpunit/base/FrmAjaxUnitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@ class FrmAjaxUnitTest extends WP_Ajax_UnitTestCase {
protected $is_pro_active = false;
protected $contact_form_key = 'contact-with-email';

/**
* Narrows the inherited property to the Formidable factory so static analysis
* can resolve $this->factory->form, ->field and ->entry.
*
* @var FrmUnitTestFactory
*/
protected $factory;

public static function wpSetUpBeforeClass( $factory ) {
$_POST = array();
FrmHooksController::trigger_load_hook( 'load_ajax_hooks' );
Expand Down
8 changes: 8 additions & 0 deletions tests/phpunit/base/FrmUnitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@ class FrmUnitTest extends WP_UnitTestCase {

protected $is_pro_active = false;

/**
* Narrows the inherited property to the Formidable factory so static analysis
* can resolve $this->factory->form, ->field and ->entry.
*
* @var FrmUnitTestFactory
*/
protected $factory;

/**
* @var FrmUnitTest
*/
Expand Down
Loading