Code Duplication    Length = 7-8 lines in 2 locations

core/db_classes/EE_Export.class.php 1 location

@@ 572-578 (lines=7) @@
569
	 *			@return string on success, FALSE on fail
570
	 */
571
	private function generate_filename ( $export_name = '' ) {
572
		if ( $export_name != '' ) {
573
			$filename = get_bloginfo('name') . '-' . $export_name;
574
			$filename = sanitize_key( $filename ) . '-' . $this->today;
575
			return $filename;
576
		}	 else {
577
			EE_Error::add_error(__("No filename was provided", "event_espresso"), __FILE__, __FUNCTION__, __LINE__ );
578
		}
579
		return false;
580
	}
581

core/helpers/EEH_URL.helper.php 1 location

@@ 25-32 (lines=8) @@
22
	 * @return string
23
	 */
24
	public static function add_query_args_and_nonce( $args = array(), $url = '', $exclude_nonce = false ) {
25
		if ( empty( $url ) ) {
26
			$user_msg = __('An error occurred. A URL is a required parameter for the add_query_args_and_nonce method.', 'event_espresso' );
27
			$dev_msg = $user_msg . "\n" . sprintf(
28
					__('In order to dynamically generate nonces for your actions, you need to supply a valid URL as a second parameter for the %s::add_query_args_and_nonce method.', 'event_espresso' ),
29
					__CLASS__
30
				);
31
			EE_Error::add_error( $user_msg . '||' . $dev_msg, __FILE__, __FUNCTION__, __LINE__ );
32
		}
33
		// check that an action exists and add nonce
34
		if ( ! $exclude_nonce ) {
35
			if ( isset( $args['action'] ) && ! empty( $args['action'] ) ) {