From 202bf57c53010df84d69c92c4cb841bc6310d5d8 Mon Sep 17 00:00:00 2001 From: nikitozzzzzzz Date: Thu, 27 Sep 2018 23:30:34 +0300 Subject: [PATCH] - fixed small notices; --- includes/core/class-fields.php | 2 +- includes/core/class-files.php | 2 -- includes/core/class-profile.php | 12 ++++++------ includes/core/class-uploader.php | 2 ++ includes/core/um-actions-form.php | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/includes/core/class-fields.php b/includes/core/class-fields.php index 463f18a8..9a266eff 100644 --- a/includes/core/class-fields.php +++ b/includes/core/class-fields.php @@ -2493,7 +2493,7 @@ if ( ! class_exists( 'um\core\Fields' ) ) { } - if( ! empty( $placeholder ) ) { + if ( ! empty( $placeholder ) && is_string( $placeholder ) ) { $placeholder = strip_tags( $placeholder ); } diff --git a/includes/core/class-files.php b/includes/core/class-files.php index a492507a..8a655e54 100644 --- a/includes/core/class-files.php +++ b/includes/core/class-files.php @@ -39,7 +39,6 @@ if ( ! class_exists( 'um\core\Files' ) ) { $this->setup_paths(); - //add_action( 'template_redirect', array( &$this, 'file_download' ) ); add_action( 'template_redirect', array( &$this, 'download_routing' ) ); $this->fonticon = array( @@ -144,7 +143,6 @@ if ( ! class_exists( 'um\core\Files' ) ) { } $download_type = $field_data[ $field_key ]['type']; - if ( $download_type === 'file' ) { $this->file_download( $user_id, $field_key, $field_value ); } else { diff --git a/includes/core/class-profile.php b/includes/core/class-profile.php index 5ea09603..1b6d7e79 100644 --- a/includes/core/class-profile.php +++ b/includes/core/class-profile.php @@ -76,7 +76,7 @@ if ( ! class_exists( 'um\core\Profile' ) ) { /** * All tab data * - * @return mixed|void + * @return array */ function tabs() { @@ -141,7 +141,7 @@ if ( ! class_exists( 'um\core\Profile' ) ) { /** * Tabs that are active * - * @return mixed|void + * @return array */ function tabs_active() { $tabs = $this->tabs(); @@ -161,7 +161,7 @@ if ( ! class_exists( 'um\core\Profile' ) ) { * * @return array */ - function tabs_primary(){ + function tabs_primary() { $tabs = $this->tabs(); $primary = array(); foreach ( $tabs as $id => $info ) { @@ -178,7 +178,7 @@ if ( ! class_exists( 'um\core\Profile' ) ) { * * @return string */ - function tabs_enabled(){ + function tabs_enabled() { $tabs = $this->tabs(); foreach( $tabs as $id => $info ){ if ( isset( $info['name'] ) ) { @@ -266,7 +266,7 @@ if ( ! class_exists( 'um\core\Profile' ) ) { /** * Get active_tab * - * @return mixed|void + * @return string */ function active_tab() { @@ -306,7 +306,7 @@ if ( ! class_exists( 'um\core\Profile' ) ) { /** * Get active active_subnav * - * @return mixed|null + * @return string|null */ function active_subnav() { diff --git a/includes/core/class-uploader.php b/includes/core/class-uploader.php index 43259a43..8d3c54c8 100644 --- a/includes/core/class-uploader.php +++ b/includes/core/class-uploader.php @@ -1127,6 +1127,8 @@ if ( ! class_exists( 'um\core\Uploader' ) ) { } $submitted = get_user_meta( $user_id, 'submitted', true ); + $submitted = ! empty( $submitted ) ? $submitted : array(); + $submitted[ $key ] = $new_filename; update_user_meta( $user_id, 'submitted', $submitted ); diff --git a/includes/core/um-actions-form.php b/includes/core/um-actions-form.php index 5cf15388..42a3670a 100644 --- a/includes/core/um-actions-form.php +++ b/includes/core/um-actions-form.php @@ -425,7 +425,7 @@ function um_submit_form_errors_hook_( $args ) { */ do_action( 'um_add_error_on_form_submit_validation', $array, $key, $args ); - if ( isset( $args[$key] ) ) { + if ( isset( $args[ $key ] ) ) { if ( isset( $array['required'] ) && $array['required'] == 1 ) { if ( ! isset( $args[$key] ) || $args[$key] == '' || $args[$key] == 'empty_file') {