Quantcast
Channel: WordPress.org Forums » [Forminator Forms – Contact Form, Payment Form & Custom Form Builder] Support
Viewing all articles
Browse latest Browse all 1451

PHP Deprecated: strpos()

$
0
0

Replies: 0

I got a PHP notice while debugging a Forminator form:

class ForminatorHooksDebugger {

private $entry_id = 'N/A';

public function __construct() {
add_filter( 'forminator_replace_form_data', array( $this, 'replace_form_data' ), 10, 3 );
}

public function replace_form_data( $content, $data, $original_content) {
error_log( "Hook: forminator_form_replace_form_data - Form ID: " . $data['form_id'] );
$this->log_current_entry( $data['form_id'], "replace_form_data", $data);

}

private function log_current_entry( $form_id, $hook_name, $entry = null ) {
if (is_null($entry)) {
error_log( "Current Entry (within " . $hook_name . "): Entry is not available at this point." );
return;
}

if (is_object($entry) or is_array($entry)) {
error_log( "Current Entry (within " . $hook_name . "): " . print_r( $entry, true ) );
} else {
error_log("Current Entry (within " . $hook_name . "): Entry format is unknown.");
error_log(print_r($entry, true));
return;
}

}
}

new ForminatorHooksDebugger();

The Notice is:

[06-Feb-2025 07:52:59 UTC] PHP Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /public_html/wp-content/plugins/forminator/library/helpers/helper-fields.php on line 1138

There are a multi-upload field and some hidden fields in the form.


Viewing all articles
Browse latest Browse all 1451

Trending Articles