Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/clone/wp-conte.../plugins/ninja-fo.../includes/AJAX/Controll...
File: Submission.php
if( $data = $action_class->process($action[ 'settings' ], $this->_form_id, $this->_data ) )
[500] Fix | Delete
{
[501] Fix | Delete
$this->_data = apply_filters( 'ninja_forms_post_run_action_type_' . $action[ 'settings' ][ 'type' ], $data );
[502] Fix | Delete
}
[503] Fix | Delete
}
[504] Fix | Delete
[505] Fix | Delete
// $this->_data[ 'actions' ][ $type ][] = $action;
[506] Fix | Delete
[507] Fix | Delete
$this->maybe_halt( $action[ 'id' ] );
[508] Fix | Delete
}
[509] Fix | Delete
[510] Fix | Delete
do_action( 'ninja_forms_after_submission', $this->_data );
[511] Fix | Delete
[512] Fix | Delete
$this->_respond();
[513] Fix | Delete
}
[514] Fix | Delete
[515] Fix | Delete
/**
[516] Fix | Delete
* Upon request, preserve a resumed action's extra data from before halt
[517] Fix | Delete
*
[518] Fix | Delete
* @return void
[519] Fix | Delete
*/
[520] Fix | Delete
private function maybePreserveExtraData(): void
[521] Fix | Delete
{
[522] Fix | Delete
if (
[523] Fix | Delete
isset($this->_data['resume']) &&
[524] Fix | Delete
isset($this->_data['resume']['preserve_extra_data'])
[525] Fix | Delete
) {
[526] Fix | Delete
$preservedKey = $this->_data['resume']['preserve_extra_data'];
[527] Fix | Delete
[528] Fix | Delete
if (isset($this->_data['extra'][$preservedKey])) {
[529] Fix | Delete
$this->_form_data['extra'][$preservedKey] = $this->_data['extra'][$preservedKey];
[530] Fix | Delete
}
[531] Fix | Delete
}
[532] Fix | Delete
}
[533] Fix | Delete
[534] Fix | Delete
protected function validate_field( $field_settings )
[535] Fix | Delete
{
[536] Fix | Delete
$field_settings = apply_filters( 'ninja_forms_pre_validate_field_settings', $field_settings );
[537] Fix | Delete
[538] Fix | Delete
if( ! is_string( $field_settings['type'] ) ) return;
[539] Fix | Delete
[540] Fix | Delete
$field_class = Ninja_Forms()->fields[ $field_settings['type'] ];
[541] Fix | Delete
[542] Fix | Delete
// if field_class is neither object nor string return before method_exists call
[543] Fix | Delete
if(!is_object($field_class) && !is_string($field_class)){
[544] Fix | Delete
return;
[545] Fix | Delete
}
[546] Fix | Delete
[547] Fix | Delete
if( ! method_exists( $field_class, 'validate' ) ) return;
[548] Fix | Delete
[549] Fix | Delete
if( $errors = $field_class->validate( $field_settings, $this->_form_data ) ){
[550] Fix | Delete
$field_id = $field_settings[ 'id' ];
[551] Fix | Delete
$this->_errors[ 'fields' ][ $field_id ] = $errors;
[552] Fix | Delete
$this->_respond();
[553] Fix | Delete
}
[554] Fix | Delete
}
[555] Fix | Delete
[556] Fix | Delete
protected function process_field( $field_settings )
[557] Fix | Delete
{
[558] Fix | Delete
if( ! is_string( $field_settings['type'] ) ) return;
[559] Fix | Delete
[560] Fix | Delete
$field_class = Ninja_Forms()->fields[ $field_settings['type'] ];
[561] Fix | Delete
[562] Fix | Delete
if( ! method_exists( $field_class, 'process' ) ) return;
[563] Fix | Delete
[564] Fix | Delete
if( $data = $field_class->process( $field_settings, $this->_form_data ) ){
[565] Fix | Delete
$this->_form_data = $data;
[566] Fix | Delete
}
[567] Fix | Delete
}
[568] Fix | Delete
[569] Fix | Delete
protected function maybe_halt( $action_id )
[570] Fix | Delete
{
[571] Fix | Delete
if( isset( $this->_data[ 'errors' ] ) && $this->_data[ 'errors' ] ){
[572] Fix | Delete
$this->_respond();
[573] Fix | Delete
}
[574] Fix | Delete
[575] Fix | Delete
if( isset( $this->_data[ 'halt' ] ) && $this->_data[ 'halt' ] ){
[576] Fix | Delete
[577] Fix | Delete
Ninja_Forms()->session()->set( 'nf_processing_data', $this->_data );
[578] Fix | Delete
Ninja_Forms()->session()->set( 'nf_processing_form_data', $this->_form_data );
[579] Fix | Delete
Ninja_Forms()->session()->set( 'nf_processing_form_cache', $this->_form_cache );
[580] Fix | Delete
[581] Fix | Delete
$this->_respond();
[582] Fix | Delete
}
[583] Fix | Delete
[584] Fix | Delete
array_push( $this->_data[ 'processed_actions' ], $action_id );
[585] Fix | Delete
}
[586] Fix | Delete
[587] Fix | Delete
protected function sort_form_actions( $a, $b )
[588] Fix | Delete
{
[589] Fix | Delete
if( is_object( $a ) ) {
[590] Fix | Delete
if( ! isset( Ninja_Forms()->actions[ $a->get_setting( 'type' ) ] ) ) return -1;
[591] Fix | Delete
$a = Ninja_Forms()->actions[ $a->get_setting( 'type' ) ];
[592] Fix | Delete
} else {
[593] Fix | Delete
if( ! isset( Ninja_Forms()->actions[ $a[ 'settings' ][ 'type' ] ] ) ) return -1;
[594] Fix | Delete
$a = Ninja_Forms()->actions[ $a[ 'settings' ][ 'type' ] ];
[595] Fix | Delete
}
[596] Fix | Delete
[597] Fix | Delete
if( is_object( $b ) ) {
[598] Fix | Delete
if( ! isset( Ninja_Forms()->actions[ $b->get_setting( 'type' ) ] ) ) return 1;
[599] Fix | Delete
$b = Ninja_Forms()->actions[ $b->get_setting( 'type' ) ];
[600] Fix | Delete
} else {
[601] Fix | Delete
if( ! isset( Ninja_Forms()->actions[ $b[ 'settings' ][ 'type' ] ] ) ) return 1;
[602] Fix | Delete
$b = Ninja_Forms()->actions[ $b[ 'settings' ][ 'type' ] ];
[603] Fix | Delete
}
[604] Fix | Delete
[605] Fix | Delete
if ( $a->get_timing() == $b->get_timing() ) {
[606] Fix | Delete
if ( $a->get_priority() == $b->get_priority() ) {
[607] Fix | Delete
return 0;
[608] Fix | Delete
}
[609] Fix | Delete
return ( $a->get_priority() < $b->get_priority() ) ? -1 : 1;
[610] Fix | Delete
}
[611] Fix | Delete
[612] Fix | Delete
return ( $a->get_timing() < $b->get_timing() ) ? -1 : 1;
[613] Fix | Delete
}
[614] Fix | Delete
[615] Fix | Delete
public function shutdown()
[616] Fix | Delete
{
[617] Fix | Delete
$error = error_get_last();
[618] Fix | Delete
if( $error !== NULL && in_array( $error[ 'type' ], array( E_ERROR, E_CORE_ERROR, E_COMPILE_ERROR, E_USER_ERROR ) ) ) {
[619] Fix | Delete
[620] Fix | Delete
$this->_errors[ 'form' ][ 'last' ] = esc_html__( 'The server encountered an error during processing.', 'ninja-forms' );
[621] Fix | Delete
[622] Fix | Delete
if( current_user_can( 'manage_options' ) && isset( $error[ 'message' ] ) ){
[623] Fix | Delete
$this->_errors[ 'form' ][ 'last_admin' ] = '<pre>' . $error[ 'message' ] . '</pre>';
[624] Fix | Delete
}
[625] Fix | Delete
[626] Fix | Delete
$this->_errors[ 'last' ] = $error;
[627] Fix | Delete
Ninja_Forms()->logger()->emergency( $error[ 'message' ] );
[628] Fix | Delete
$this->_respond();
[629] Fix | Delete
}
[630] Fix | Delete
}
[631] Fix | Delete
[632] Fix | Delete
protected function form_data_check()
[633] Fix | Delete
{
[634] Fix | Delete
if( $this->_form_data ) return;
[635] Fix | Delete
[636] Fix | Delete
if( function_exists( 'json_last_error' ) // Function not supported in php5.2
[637] Fix | Delete
&& function_exists( 'json_last_error_msg' )// Function not supported in php5.4
[638] Fix | Delete
&& json_last_error() ){
[639] Fix | Delete
$this->_errors[] = json_last_error_msg();
[640] Fix | Delete
} else {
[641] Fix | Delete
$this->_errors[] = esc_html__( 'An unexpected error occurred.', 'ninja-forms' );
[642] Fix | Delete
}
[643] Fix | Delete
[644] Fix | Delete
$this->_respond();
[645] Fix | Delete
}
[646] Fix | Delete
[647] Fix | Delete
protected function is_preview()
[648] Fix | Delete
{
[649] Fix | Delete
if( ! isset( $this->_form_data[ 'settings' ][ 'is_preview' ] ) ) return false;
[650] Fix | Delete
return $this->_form_data[ 'settings' ][ 'is_preview' ];
[651] Fix | Delete
}
[652] Fix | Delete
[653] Fix | Delete
/*
[654] Fix | Delete
* Overwrite method for parent class.
[655] Fix | Delete
*/
[656] Fix | Delete
protected function _respond( $data = array() )
[657] Fix | Delete
{
[658] Fix | Delete
// Restore form instance ID.
[659] Fix | Delete
if(property_exists($this, '_form_instance_id')
[660] Fix | Delete
&& $this->_form_instance_id){
[661] Fix | Delete
$this->_data[ 'form_id' ] = $this->_form_instance_id;
[662] Fix | Delete
[663] Fix | Delete
// Maybe update IDs for field errors, if there are field errors.
[664] Fix | Delete
if(isset($this->_errors['fields']) && $this->_errors['fields']){
[665] Fix | Delete
$field_errors = array();
[666] Fix | Delete
foreach($this->_errors['fields'] as $field_id => $error){
[667] Fix | Delete
$field_errors[$field_id . '_' . $this->_instance_id] = $error;
[668] Fix | Delete
}
[669] Fix | Delete
$this->_errors['fields'] = $field_errors;
[670] Fix | Delete
}
[671] Fix | Delete
}
[672] Fix | Delete
[673] Fix | Delete
// Set a content type of JSON for the purpose of previnting XSS attacks.
[674] Fix | Delete
header( 'Content-Type: application/json' );
[675] Fix | Delete
// Call the parent method.
[676] Fix | Delete
parent::_respond();
[677] Fix | Delete
}
[678] Fix | Delete
[679] Fix | Delete
/**
[680] Fix | Delete
* Process fields merge tags for fields inside a repeater fieldset
[681] Fix | Delete
*
[682] Fix | Delete
* @param object $field The Repeater Fieldset
[683] Fix | Delete
*
[684] Fix | Delete
*/
[685] Fix | Delete
protected function process_repeater_fields_merge_tags( $field ){
[686] Fix | Delete
//Compare the Repeater field passed calling the function with the array of fields values from the submission object
[687] Fix | Delete
foreach( $this->_form_data['fields'][$field->get_id()]['value'] as $id => $data ){
[688] Fix | Delete
//Check if field is a Repeater Field
[689] Fix | Delete
if( Ninja_Forms()->fieldsetRepeater->isRepeaterFieldByFieldReference($id) && !empty($data['value']) && is_string($data['value']) ) {
[690] Fix | Delete
//Merge tags in the Repeater Field Sub Fields values
[691] Fix | Delete
$this->_form_data['fields'][$field->get_id()]['value'][$id]['value'] = apply_filters( 'ninja_forms_merge_tags', $data['value'] );
[692] Fix | Delete
}
[693] Fix | Delete
}
[694] Fix | Delete
}
[695] Fix | Delete
}
[696] Fix | Delete
[697] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function