Code Duplication    Length = 5-13 lines in 2 locations

core/helpers/EEH_Sideloader.helper.php 1 location

@@ 152-156 (lines=5) @@
149
		$path = apply_filters( 'FHEE__EEH_Sideloader__sideload__new_path', $this->_upload_to . $this->_new_file_name, $this );
150
151
		//move file in
152
		if ( false === @ rename( $file, $path ) ) {
153
			unlink( $temp_file );
154
			EE_Error::add_error(  sprintf( __('Unable to move the file to new location (possible permissions errors). This is the path the class attempted to move the file to: %s', 'event_espresso' ), $path ), __FILE__, __FUNCTION__, __LINE__ );
155
			return false;
156
		}
157
158
		//set permissions
159
		$permissions = apply_filters( 'FHEE__EEH_Sideloader__sideload__permissions_applied', $this->_permissions, $this );

core/db_models/EEM_Base.model.php 1 location

@@ 1924-1936 (lines=13) @@
1921
			}elseif( $result === false ){
1922
				throw new EE_Error( sprintf( __( 'WPDB Error occurred, but no error message was logged by wpdb! The wpdb method called was "%1$s" and the arguments were "%2$s"', 'event_espresso' ), $wpdb_method, var_export( $arguments_to_provide, true ) ) );
1923
			}
1924
		}elseif( $result === false ) {
1925
			EE_Error::add_error(
1926
				sprintf(
1927
					__( 'A database error has occurred. Turn on WP_DEBUG for more information.||A database error occurred doing wpdb method "%1$s", with arguments "%2$s". The error was "%3$s"', 'event_espresso' ),
1928
					$wpdb_method,
1929
					var_export( $arguments_to_provide, true ),
1930
					$wpdb->last_error
1931
				),
1932
				__FILE__,
1933
				__FUNCTION__,
1934
				__LINE__
1935
			);
1936
		}
1937
		return $result;
1938
	}
1939