Completed
Push — master ( c0c536...fdb3a7 )
by Stephen
20:33
created
src/wp-includes/post-formats.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -135,7 +135,7 @@
 block discarded – undo
135 135
  * @since 3.1.0
136 136
  *
137 137
  * @param string $format The post format slug.
138
- * @return string|WP_Error|false The post format term link.
138
+ * @return string The post format term link.
139 139
  */
140 140
 function get_post_format_link( $format ) {
141 141
 	$term = get_term_by('slug', 'post-format-' . $format, 'post_format' );
Please login to merge, or discard this patch.
Braces   +35 added lines, -25 removed lines patch added patch discarded remove patch
@@ -15,16 +15,19 @@  discard block
 block discarded – undo
15 15
  * @return string|false The format if successful. False otherwise.
16 16
  */
17 17
 function get_post_format( $post = null ) {
18
-	if ( ! $post = get_post( $post ) )
19
-		return false;
18
+	if ( ! $post = get_post( $post ) ) {
19
+			return false;
20
+	}
20 21
 
21
-	if ( ! post_type_supports( $post->post_type, 'post-formats' ) )
22
-		return false;
22
+	if ( ! post_type_supports( $post->post_type, 'post-formats' ) ) {
23
+			return false;
24
+	}
23 25
 
24 26
 	$_format = get_the_terms( $post->ID, 'post_format' );
25 27
 
26
-	if ( empty( $_format ) )
27
-		return false;
28
+	if ( empty( $_format ) ) {
29
+			return false;
30
+	}
28 31
 
29 32
 	$format = reset( $_format );
30 33
 
@@ -64,15 +67,17 @@  discard block
 block discarded – undo
64 67
 function set_post_format( $post, $format ) {
65 68
 	$post = get_post( $post );
66 69
 
67
-	if ( empty( $post ) )
68
-		return new WP_Error( 'invalid_post', __( 'Invalid post.' ) );
70
+	if ( empty( $post ) ) {
71
+			return new WP_Error( 'invalid_post', __( 'Invalid post.' ) );
72
+	}
69 73
 
70 74
 	if ( ! empty( $format ) ) {
71 75
 		$format = sanitize_key( $format );
72
-		if ( 'standard' === $format || ! in_array( $format, get_post_format_slugs() ) )
73
-			$format = '';
74
-		else
75
-			$format = 'post-format-' . $format;
76
+		if ( 'standard' === $format || ! in_array( $format, get_post_format_slugs() ) ) {
77
+					$format = '';
78
+		} else {
79
+					$format = 'post-format-' . $format;
80
+		}
76 81
 	}
77 82
 
78 83
 	return wp_set_post_terms( $post->ID, $format, 'post_format' );
@@ -123,11 +128,12 @@  discard block
 block discarded – undo
123 128
  */
124 129
 function get_post_format_string( $slug ) {
125 130
 	$strings = get_post_format_strings();
126
-	if ( !$slug )
127
-		return $strings['standard'];
128
-	else
129
-		return ( isset( $strings[$slug] ) ) ? $strings[$slug] : '';
130
-}
131
+	if ( !$slug ) {
132
+			return $strings['standard'];
133
+	} else {
134
+			return ( isset( $strings[$slug] ) ) ? $strings[$slug] : '';
135
+	}
136
+	}
131 137
 
132 138
 /**
133 139
  * Returns a link to a post format index.
@@ -139,8 +145,9 @@  discard block
 block discarded – undo
139 145
  */
140 146
 function get_post_format_link( $format ) {
141 147
 	$term = get_term_by('slug', 'post-format-' . $format, 'post_format' );
142
-	if ( ! $term || is_wp_error( $term ) )
143
-		return false;
148
+	if ( ! $term || is_wp_error( $term ) ) {
149
+			return false;
150
+	}
144 151
 	return get_term_link( $term );
145 152
 }
146 153
 
@@ -154,14 +161,17 @@  discard block
 block discarded – undo
154 161
  * @return array
155 162
  */
156 163
 function _post_format_request( $qvs ) {
157
-	if ( ! isset( $qvs['post_format'] ) )
158
-		return $qvs;
164
+	if ( ! isset( $qvs['post_format'] ) ) {
165
+			return $qvs;
166
+	}
159 167
 	$slugs = get_post_format_slugs();
160
-	if ( isset( $slugs[ $qvs['post_format'] ] ) )
161
-		$qvs['post_format'] = 'post-format-' . $slugs[ $qvs['post_format'] ];
168
+	if ( isset( $slugs[ $qvs['post_format'] ] ) ) {
169
+			$qvs['post_format'] = 'post-format-' . $slugs[ $qvs['post_format'] ];
170
+	}
162 171
 	$tax = get_taxonomy( 'post_format' );
163
-	if ( ! is_admin() )
164
-		$qvs['post_type'] = $tax->object_type;
172
+	if ( ! is_admin() ) {
173
+			$qvs['post_type'] = $tax->object_type;
174
+	}
165 175
 	return $qvs;
166 176
 }
167 177
 
Please login to merge, or discard this patch.
Spacing   +67 added lines, -67 removed lines patch added patch discarded remove patch
@@ -14,21 +14,21 @@  discard block
 block discarded – undo
14 14
  * @param int|object|null $post Post ID or post object. Optional, default is the current post from the loop.
15 15
  * @return string|false The format if successful. False otherwise.
16 16
  */
17
-function get_post_format( $post = null ) {
18
-	if ( ! $post = get_post( $post ) )
17
+function get_post_format($post = null) {
18
+	if ( ! $post = get_post($post))
19 19
 		return false;
20 20
 
21
-	if ( ! post_type_supports( $post->post_type, 'post-formats' ) )
21
+	if ( ! post_type_supports($post->post_type, 'post-formats'))
22 22
 		return false;
23 23
 
24
-	$_format = get_the_terms( $post->ID, 'post_format' );
24
+	$_format = get_the_terms($post->ID, 'post_format');
25 25
 
26
-	if ( empty( $_format ) )
26
+	if (empty($_format))
27 27
 		return false;
28 28
 
29
-	$format = reset( $_format );
29
+	$format = reset($_format);
30 30
 
31
-	return str_replace('post-format-', '', $format->slug );
31
+	return str_replace('post-format-', '', $format->slug);
32 32
 }
33 33
 
34 34
 /**
@@ -40,16 +40,16 @@  discard block
 block discarded – undo
40 40
  * @param object|int|null $post   Optional. The post to check. If not supplied, defaults to the current post if used in the loop.
41 41
  * @return bool True if the post has any of the given formats (or any format, if no format specified), false otherwise.
42 42
  */
43
-function has_post_format( $format = array(), $post = null ) {
43
+function has_post_format($format = array(), $post = null) {
44 44
 	$prefixed = array();
45 45
 
46
-	if ( $format ) {
47
-		foreach ( (array) $format as $single ) {
48
-			$prefixed[] = 'post-format-' . sanitize_key( $single );
46
+	if ($format) {
47
+		foreach ((array) $format as $single) {
48
+			$prefixed[] = 'post-format-'.sanitize_key($single);
49 49
 		}
50 50
 	}
51 51
 
52
-	return has_term( $prefixed, 'post_format', $post );
52
+	return has_term($prefixed, 'post_format', $post);
53 53
 }
54 54
 
55 55
 /**
@@ -61,21 +61,21 @@  discard block
 block discarded – undo
61 61
  * @param string     $format A format to assign. Use an empty string or array to remove all formats from the post.
62 62
  * @return array|WP_Error|false WP_Error on error. Array of affected term IDs on success.
63 63
  */
64
-function set_post_format( $post, $format ) {
65
-	$post = get_post( $post );
64
+function set_post_format($post, $format) {
65
+	$post = get_post($post);
66 66
 
67
-	if ( empty( $post ) )
68
-		return new WP_Error( 'invalid_post', __( 'Invalid post.' ) );
67
+	if (empty($post))
68
+		return new WP_Error('invalid_post', __('Invalid post.'));
69 69
 
70
-	if ( ! empty( $format ) ) {
71
-		$format = sanitize_key( $format );
72
-		if ( 'standard' === $format || ! in_array( $format, get_post_format_slugs() ) )
70
+	if ( ! empty($format)) {
71
+		$format = sanitize_key($format);
72
+		if ('standard' === $format || ! in_array($format, get_post_format_slugs()))
73 73
 			$format = '';
74 74
 		else
75
-			$format = 'post-format-' . $format;
75
+			$format = 'post-format-'.$format;
76 76
 	}
77 77
 
78
-	return wp_set_post_terms( $post->ID, $format, 'post_format' );
78
+	return wp_set_post_terms($post->ID, $format, 'post_format');
79 79
 }
80 80
 
81 81
 /**
@@ -87,16 +87,16 @@  discard block
 block discarded – undo
87 87
  */
88 88
 function get_post_format_strings() {
89 89
 	$strings = array(
90
-		'standard' => _x( 'Standard', 'Post format' ), // Special case. any value that evals to false will be considered standard
91
-		'aside'    => _x( 'Aside',    'Post format' ),
92
-		'chat'     => _x( 'Chat',     'Post format' ),
93
-		'gallery'  => _x( 'Gallery',  'Post format' ),
94
-		'link'     => _x( 'Link',     'Post format' ),
95
-		'image'    => _x( 'Image',    'Post format' ),
96
-		'quote'    => _x( 'Quote',    'Post format' ),
97
-		'status'   => _x( 'Status',   'Post format' ),
98
-		'video'    => _x( 'Video',    'Post format' ),
99
-		'audio'    => _x( 'Audio',    'Post format' ),
90
+		'standard' => _x('Standard', 'Post format'), // Special case. any value that evals to false will be considered standard
91
+		'aside'    => _x('Aside', 'Post format'),
92
+		'chat'     => _x('Chat', 'Post format'),
93
+		'gallery'  => _x('Gallery', 'Post format'),
94
+		'link'     => _x('Link', 'Post format'),
95
+		'image'    => _x('Image', 'Post format'),
96
+		'quote'    => _x('Quote', 'Post format'),
97
+		'status'   => _x('Status', 'Post format'),
98
+		'video'    => _x('Video', 'Post format'),
99
+		'audio'    => _x('Audio', 'Post format'),
100 100
 	);
101 101
 	return $strings;
102 102
 }
@@ -109,8 +109,8 @@  discard block
 block discarded – undo
109 109
  * @return array The array of post format slugs.
110 110
  */
111 111
 function get_post_format_slugs() {
112
-	$slugs = array_keys( get_post_format_strings() );
113
-	return array_combine( $slugs, $slugs );
112
+	$slugs = array_keys(get_post_format_strings());
113
+	return array_combine($slugs, $slugs);
114 114
 }
115 115
 
116 116
 /**
@@ -121,12 +121,12 @@  discard block
 block discarded – undo
121 121
  * @param string $slug A post format slug.
122 122
  * @return string The translated post format name.
123 123
  */
124
-function get_post_format_string( $slug ) {
124
+function get_post_format_string($slug) {
125 125
 	$strings = get_post_format_strings();
126
-	if ( !$slug )
126
+	if ( ! $slug)
127 127
 		return $strings['standard'];
128 128
 	else
129
-		return ( isset( $strings[$slug] ) ) ? $strings[$slug] : '';
129
+		return (isset($strings[$slug])) ? $strings[$slug] : '';
130 130
 }
131 131
 
132 132
 /**
@@ -137,11 +137,11 @@  discard block
 block discarded – undo
137 137
  * @param string $format The post format slug.
138 138
  * @return string|WP_Error|false The post format term link.
139 139
  */
140
-function get_post_format_link( $format ) {
141
-	$term = get_term_by('slug', 'post-format-' . $format, 'post_format' );
142
-	if ( ! $term || is_wp_error( $term ) )
140
+function get_post_format_link($format) {
141
+	$term = get_term_by('slug', 'post-format-'.$format, 'post_format');
142
+	if ( ! $term || is_wp_error($term))
143 143
 		return false;
144
-	return get_term_link( $term );
144
+	return get_term_link($term);
145 145
 }
146 146
 
147 147
 /**
@@ -153,14 +153,14 @@  discard block
 block discarded – undo
153 153
  * @param array $qvs
154 154
  * @return array
155 155
  */
156
-function _post_format_request( $qvs ) {
157
-	if ( ! isset( $qvs['post_format'] ) )
156
+function _post_format_request($qvs) {
157
+	if ( ! isset($qvs['post_format']))
158 158
 		return $qvs;
159 159
 	$slugs = get_post_format_slugs();
160
-	if ( isset( $slugs[ $qvs['post_format'] ] ) )
161
-		$qvs['post_format'] = 'post-format-' . $slugs[ $qvs['post_format'] ];
162
-	$tax = get_taxonomy( 'post_format' );
163
-	if ( ! is_admin() )
160
+	if (isset($slugs[$qvs['post_format']]))
161
+		$qvs['post_format'] = 'post-format-'.$slugs[$qvs['post_format']];
162
+	$tax = get_taxonomy('post_format');
163
+	if ( ! is_admin())
164 164
 		$qvs['post_type'] = $tax->object_type;
165 165
 	return $qvs;
166 166
 }
@@ -178,16 +178,16 @@  discard block
 block discarded – undo
178 178
  * @param string $taxonomy
179 179
  * @return string
180 180
  */
181
-function _post_format_link( $link, $term, $taxonomy ) {
181
+function _post_format_link($link, $term, $taxonomy) {
182 182
 	global $wp_rewrite;
183
-	if ( 'post_format' != $taxonomy ) {
183
+	if ('post_format' != $taxonomy) {
184 184
 		return $link;
185 185
 	}
186
-	if ( $wp_rewrite->get_extra_permastruct( $taxonomy ) ) {
187
-		return str_replace( "/{$term->slug}", '/' . str_replace( 'post-format-', '', $term->slug ), $link );
186
+	if ($wp_rewrite->get_extra_permastruct($taxonomy)) {
187
+		return str_replace("/{$term->slug}", '/'.str_replace('post-format-', '', $term->slug), $link);
188 188
 	} else {
189
-		$link = remove_query_arg( 'post_format', $link );
190
-		return add_query_arg( 'post_format', str_replace( 'post-format-', '', $term->slug ), $link );
189
+		$link = remove_query_arg('post_format', $link);
190
+		return add_query_arg('post_format', str_replace('post-format-', '', $term->slug), $link);
191 191
 	}
192 192
 }
193 193
 
@@ -200,9 +200,9 @@  discard block
 block discarded – undo
200 200
  * @param object $term
201 201
  * @return object
202 202
  */
203
-function _post_format_get_term( $term ) {
204
-	if ( isset( $term->slug ) ) {
205
-		$term->name = get_post_format_string( str_replace( 'post-format-', '', $term->slug ) );
203
+function _post_format_get_term($term) {
204
+	if (isset($term->slug)) {
205
+		$term->name = get_post_format_string(str_replace('post-format-', '', $term->slug));
206 206
 	}
207 207
 	return $term;
208 208
 }
@@ -218,16 +218,16 @@  discard block
 block discarded – undo
218 218
  * @param array        $args
219 219
  * @return array
220 220
  */
221
-function _post_format_get_terms( $terms, $taxonomies, $args ) {
222
-	if ( in_array( 'post_format', (array) $taxonomies ) ) {
223
-		if ( isset( $args['fields'] ) && 'names' == $args['fields'] ) {
224
-			foreach ( $terms as $order => $name ) {
225
-				$terms[$order] = get_post_format_string( str_replace( 'post-format-', '', $name ) );
221
+function _post_format_get_terms($terms, $taxonomies, $args) {
222
+	if (in_array('post_format', (array) $taxonomies)) {
223
+		if (isset($args['fields']) && 'names' == $args['fields']) {
224
+			foreach ($terms as $order => $name) {
225
+				$terms[$order] = get_post_format_string(str_replace('post-format-', '', $name));
226 226
 			}
227 227
 		} else {
228
-			foreach ( (array) $terms as $order => $term ) {
229
-				if ( isset( $term->taxonomy ) && 'post_format' == $term->taxonomy ) {
230
-					$terms[$order]->name = get_post_format_string( str_replace( 'post-format-', '', $term->slug ) );
228
+			foreach ((array) $terms as $order => $term) {
229
+				if (isset($term->taxonomy) && 'post_format' == $term->taxonomy) {
230
+					$terms[$order]->name = get_post_format_string(str_replace('post-format-', '', $term->slug));
231 231
 				}
232 232
 			}
233 233
 		}
@@ -244,10 +244,10 @@  discard block
 block discarded – undo
244 244
  * @param array $terms
245 245
  * @return array
246 246
  */
247
-function _post_format_wp_get_object_terms( $terms ) {
248
-	foreach ( (array) $terms as $order => $term ) {
249
-		if ( isset( $term->taxonomy ) && 'post_format' == $term->taxonomy ) {
250
-			$terms[$order]->name = get_post_format_string( str_replace( 'post-format-', '', $term->slug ) );
247
+function _post_format_wp_get_object_terms($terms) {
248
+	foreach ((array) $terms as $order => $term) {
249
+		if (isset($term->taxonomy) && 'post_format' == $term->taxonomy) {
250
+			$terms[$order]->name = get_post_format_string(str_replace('post-format-', '', $term->slug));
251 251
 		}
252 252
 	}
253 253
 	return $terms;
Please login to merge, or discard this patch.
src/wp-includes/rss.php 3 patches
Doc Comments   +13 added lines, -4 removed lines patch added patch discarded remove patch
@@ -409,7 +409,7 @@  discard block
 block discarded – undo
409 409
  * @subpackage MagpieRSS
410 410
  *
411 411
  * @param string $url URL to retrieve feed
412
- * @return bool|MagpieRSS false on failure or MagpieRSS object on success.
412
+ * @return integer|null false on failure or MagpieRSS object on success.
413 413
  */
414 414
 function fetch_rss ($url) {
415 415
 	// initialize constants
@@ -547,7 +547,7 @@  discard block
 block discarded – undo
547 547
  *
548 548
  * @param string $url URL to retrieve
549 549
  * @param array $headers Optional. Headers to send to the URL.
550
- * @return Snoopy style response
550
+ * @return stdClass style response
551 551
  */
552 552
 function _fetch_remote_file($url, $headers = "" ) {
553 553
 	$resp = wp_safe_remote_request( $url, array( 'headers' => $headers, 'timeout' => MAGPIE_FETCH_TIME_OUT ) );
@@ -589,7 +589,7 @@  discard block
 block discarded – undo
589 589
  * @package External
590 590
  * @subpackage MagpieRSS
591 591
  *
592
- * @param array $resp
592
+ * @param stdClass $resp
593 593
  * @return MagpieRSS|bool
594 594
  */
595 595
 function _response_to_rss ($resp) {
@@ -746,6 +746,9 @@  discard block
 block discarded – undo
746 746
 	Input:		url from wich the rss file was fetched
747 747
 	Output:		true on success
748 748
 \*=======================================================================*/
749
+	/**
750
+	 * @param string $url
751
+	 */
749 752
 	function set ($url, $rss) {
750 753
 		$cache_option = 'rss_' . $this->file_name( $url );
751 754
 
@@ -760,6 +763,9 @@  discard block
 block discarded – undo
760 763
 	Input:		url from wich the rss file was fetched
761 764
 	Output:		cached object on HIT, false on MISS
762 765
 \*=======================================================================*/
766
+	/**
767
+	 * @param string $url
768
+	 */
763 769
 	function get ($url) {
764 770
 		$this->ERROR = "";
765 771
 		$cache_option = 'rss_' . $this->file_name( $url );
@@ -781,6 +787,9 @@  discard block
 block discarded – undo
781 787
 	Input:		url from wich the rss file was fetched
782 788
 	Output:		cached object on HIT, false on MISS
783 789
 \*=======================================================================*/
790
+	/**
791
+	 * @param string $url
792
+	 */
784 793
 	function check_cache ( $url ) {
785 794
 		$this->ERROR = "";
786 795
 		$cache_option = 'rss_' . $this->file_name( $url );
@@ -936,7 +945,7 @@  discard block
 block discarded – undo
936 945
  *
937 946
  * @param string $url URL of feed to display. Will not auto sense feed URL.
938 947
  * @param int $num_items Optional. Number of items to display, default is all.
939
- * @return bool False on failure.
948
+ * @return null|false False on failure.
940 949
  */
941 950
 function get_rss ($url, $num_items = 5) { // Like get posts, but for RSS
942 951
 	$rss = fetch_rss($url);
Please login to merge, or discard this patch.
Spacing   +224 added lines, -224 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
 /**
17 17
  * Deprecated. Use SimplePie (class-simplepie.php) instead.
18 18
  */
19
-_deprecated_file( basename( __FILE__ ), '3.0', WPINC . '/class-simplepie.php' );
19
+_deprecated_file(basename(__FILE__), '3.0', WPINC.'/class-simplepie.php');
20 20
 
21 21
 /**
22 22
  * Fires before MagpieRSS is loaded, to optionally replace it.
@@ -24,32 +24,32 @@  discard block
 block discarded – undo
24 24
  * @since 2.3.0
25 25
  * @deprecated 3.0.0
26 26
  */
27
-do_action( 'load_feed_engine' );
27
+do_action('load_feed_engine');
28 28
 
29 29
 /** RSS feed constant. */
30 30
 define('RSS', 'RSS');
31 31
 define('ATOM', 'Atom');
32
-define('MAGPIE_USER_AGENT', 'WordPress/' . $GLOBALS['wp_version']);
32
+define('MAGPIE_USER_AGENT', 'WordPress/'.$GLOBALS['wp_version']);
33 33
 
34 34
 class MagpieRSS {
35 35
 	var $parser;
36
-	var $current_item	= array();	// item currently being parsed
37
-	var $items			= array();	// collection of parsed items
38
-	var $channel		= array();	// hash of channel fields
39
-	var $textinput		= array();
36
+	var $current_item = array(); // item currently being parsed
37
+	var $items			= array(); // collection of parsed items
38
+	var $channel = array(); // hash of channel fields
39
+	var $textinput = array();
40 40
 	var $image			= array();
41 41
 	var $feed_type;
42 42
 	var $feed_version;
43 43
 
44 44
 	// parser variables
45
-	var $stack				= array(); // parser stack
45
+	var $stack = array(); // parser stack
46 46
 	var $inchannel			= false;
47
-	var $initem 			= false;
47
+	var $initem = false;
48 48
 	var $incontent			= false; // if in Atom <content mode="xml"> field
49
-	var $intextinput		= false;
50
-	var $inimage 			= false;
51
-	var $current_field		= '';
52
-	var $current_namespace	= false;
49
+	var $intextinput = false;
50
+	var $inimage = false;
51
+	var $current_field = '';
52
+	var $current_namespace = false;
53 53
 
54 54
 	//var $ERROR = "";
55 55
 
@@ -58,44 +58,44 @@  discard block
 block discarded – undo
58 58
 	/**
59 59
 	 * PHP5 constructor.
60 60
 	 */
61
-	function __construct( $source ) {
61
+	function __construct($source) {
62 62
 
63 63
 		# if PHP xml isn't compiled in, die
64 64
 		#
65
-		if ( !function_exists('xml_parser_create') )
66
-			trigger_error( "Failed to load PHP's XML Extension. https://secure.php.net/manual/en/ref.xml.php" );
65
+		if ( ! function_exists('xml_parser_create'))
66
+			trigger_error("Failed to load PHP's XML Extension. https://secure.php.net/manual/en/ref.xml.php");
67 67
 
68 68
 		$parser = @xml_parser_create();
69 69
 
70
-		if ( !is_resource($parser) )
71
-			trigger_error( "Failed to create an instance of PHP's XML parser. https://secure.php.net/manual/en/ref.xml.php");
70
+		if ( ! is_resource($parser))
71
+			trigger_error("Failed to create an instance of PHP's XML parser. https://secure.php.net/manual/en/ref.xml.php");
72 72
 
73 73
 		$this->parser = $parser;
74 74
 
75 75
 		# pass in parser, and a reference to this object
76 76
 		# set up handlers
77 77
 		#
78
-		xml_set_object( $this->parser, $this );
78
+		xml_set_object($this->parser, $this);
79 79
 		xml_set_element_handler($this->parser,
80
-				'feed_start_element', 'feed_end_element' );
80
+				'feed_start_element', 'feed_end_element');
81 81
 
82
-		xml_set_character_data_handler( $this->parser, 'feed_cdata' );
82
+		xml_set_character_data_handler($this->parser, 'feed_cdata');
83 83
 
84
-		$status = xml_parse( $this->parser, $source );
84
+		$status = xml_parse($this->parser, $source);
85 85
 
86
-		if (! $status ) {
87
-			$errorcode = xml_get_error_code( $this->parser );
88
-			if ( $errorcode != XML_ERROR_NONE ) {
89
-				$xml_error = xml_error_string( $errorcode );
86
+		if ( ! $status) {
87
+			$errorcode = xml_get_error_code($this->parser);
88
+			if ($errorcode != XML_ERROR_NONE) {
89
+				$xml_error = xml_error_string($errorcode);
90 90
 				$error_line = xml_get_current_line_number($this->parser);
91 91
 				$error_col = xml_get_current_column_number($this->parser);
92 92
 				$errormsg = "$xml_error at line $error_line, column $error_col";
93 93
 
94
-				$this->error( $errormsg );
94
+				$this->error($errormsg);
95 95
 			}
96 96
 		}
97 97
 
98
-		xml_parser_free( $this->parser );
98
+		xml_parser_free($this->parser);
99 99
 
100 100
 		$this->normalize();
101 101
 	}
@@ -103,8 +103,8 @@  discard block
 block discarded – undo
103 103
 	/**
104 104
 	 * PHP4 constructor.
105 105
 	 */
106
-	public function MagpieRSS( $source ) {
107
-		self::__construct( $source );
106
+	public function MagpieRSS($source) {
107
+		self::__construct($source);
108 108
 	}
109 109
 
110 110
 	function feed_start_element($p, $element, &$attrs) {
@@ -112,27 +112,27 @@  discard block
 block discarded – undo
112 112
 		$attrs = array_change_key_case($attrs, CASE_LOWER);
113 113
 
114 114
 		// check for a namespace, and split if found
115
-		$ns	= false;
116
-		if ( strpos( $element, ':' ) ) {
117
-			list($ns, $el) = explode( ':', $element, 2);
115
+		$ns = false;
116
+		if (strpos($element, ':')) {
117
+			list($ns, $el) = explode(':', $element, 2);
118 118
 		}
119
-		if ( $ns and $ns != 'rdf' ) {
119
+		if ($ns and $ns != 'rdf') {
120 120
 			$this->current_namespace = $ns;
121 121
 		}
122 122
 
123 123
 		# if feed type isn't set, then this is first element of feed
124 124
 		# identify feed from root element
125 125
 		#
126
-		if (!isset($this->feed_type) ) {
127
-			if ( $el == 'rdf' ) {
126
+		if ( ! isset($this->feed_type)) {
127
+			if ($el == 'rdf') {
128 128
 				$this->feed_type = RSS;
129 129
 				$this->feed_version = '1.0';
130 130
 			}
131
-			elseif ( $el == 'rss' ) {
131
+			elseif ($el == 'rss') {
132 132
 				$this->feed_type = RSS;
133 133
 				$this->feed_version = $attrs['version'];
134 134
 			}
135
-			elseif ( $el == 'feed' ) {
135
+			elseif ($el == 'feed') {
136 136
 				$this->feed_type = ATOM;
137 137
 				$this->feed_version = $attrs['version'];
138 138
 				$this->inchannel = true;
@@ -140,14 +140,14 @@  discard block
 block discarded – undo
140 140
 			return;
141 141
 		}
142 142
 
143
-		if ( $el == 'channel' )
143
+		if ($el == 'channel')
144 144
 		{
145 145
 			$this->inchannel = true;
146 146
 		}
147
-		elseif ($el == 'item' or $el == 'entry' )
147
+		elseif ($el == 'item' or $el == 'entry')
148 148
 		{
149 149
 			$this->initem = true;
150
-			if ( isset($attrs['rdf:about']) ) {
150
+			if (isset($attrs['rdf:about'])) {
151 151
 				$this->current_item['about'] = $attrs['rdf:about'];
152 152
 			}
153 153
 		}
@@ -171,10 +171,10 @@  discard block
 block discarded – undo
171 171
 		}
172 172
 
173 173
 		# handle atom content constructs
174
-		elseif ( $this->feed_type == ATOM and in_array($el, $this->_CONTENT_CONSTRUCTS) )
174
+		elseif ($this->feed_type == ATOM and in_array($el, $this->_CONTENT_CONSTRUCTS))
175 175
 		{
176 176
 			// avoid clashing w/ RSS mod_content
177
-			if ($el == 'content' ) {
177
+			if ($el == 'content') {
178 178
 				$el = 'atom_content';
179 179
 			}
180 180
 
@@ -183,31 +183,31 @@  discard block
 block discarded – undo
183 183
 		}
184 184
 
185 185
 		// if inside an Atom content construct (e.g. content or summary) field treat tags as text
186
-		elseif ($this->feed_type == ATOM and $this->incontent )
186
+		elseif ($this->feed_type == ATOM and $this->incontent)
187 187
 		{
188 188
 			// if tags are inlined, then flatten
189 189
 			$attrs_str = join(' ',
190 190
 					array_map(array('MagpieRSS', 'map_attrs'),
191 191
 					array_keys($attrs),
192
-					array_values($attrs) ) );
192
+					array_values($attrs)));
193 193
 
194
-			$this->append_content( "<$element $attrs_str>"  );
194
+			$this->append_content("<$element $attrs_str>");
195 195
 
196
-			array_unshift( $this->stack, $el );
196
+			array_unshift($this->stack, $el);
197 197
 		}
198 198
 
199 199
 		// Atom support many links per containging element.
200 200
 		// Magpie treats link elements of type rel='alternate'
201 201
 		// as being equivalent to RSS's simple link element.
202 202
 		//
203
-		elseif ($this->feed_type == ATOM and $el == 'link' )
203
+		elseif ($this->feed_type == ATOM and $el == 'link')
204 204
 		{
205
-			if ( isset($attrs['rel']) and $attrs['rel'] == 'alternate' )
205
+			if (isset($attrs['rel']) and $attrs['rel'] == 'alternate')
206 206
 			{
207 207
 				$link_el = 'link';
208 208
 			}
209 209
 			else {
210
-				$link_el = 'link_' . $attrs['rel'];
210
+				$link_el = 'link_'.$attrs['rel'];
211 211
 			}
212 212
 
213 213
 			$this->append($link_el, $attrs['href']);
@@ -218,11 +218,11 @@  discard block
 block discarded – undo
218 218
 		}
219 219
 	}
220 220
 
221
-	function feed_cdata ($p, $text) {
221
+	function feed_cdata($p, $text) {
222 222
 
223 223
 		if ($this->feed_type == ATOM and $this->incontent)
224 224
 		{
225
-			$this->append_content( $text );
225
+			$this->append_content($text);
226 226
 		}
227 227
 		else {
228 228
 			$current_el = join('_', array_reverse($this->stack));
@@ -230,35 +230,35 @@  discard block
 block discarded – undo
230 230
 		}
231 231
 	}
232 232
 
233
-	function feed_end_element ($p, $el) {
233
+	function feed_end_element($p, $el) {
234 234
 		$el = strtolower($el);
235 235
 
236
-		if ( $el == 'item' or $el == 'entry' )
236
+		if ($el == 'item' or $el == 'entry')
237 237
 		{
238 238
 			$this->items[] = $this->current_item;
239 239
 			$this->current_item = array();
240 240
 			$this->initem = false;
241 241
 		}
242
-		elseif ($this->feed_type == RSS and $this->current_namespace == '' and $el == 'textinput' )
242
+		elseif ($this->feed_type == RSS and $this->current_namespace == '' and $el == 'textinput')
243 243
 		{
244 244
 			$this->intextinput = false;
245 245
 		}
246
-		elseif ($this->feed_type == RSS and $this->current_namespace == '' and $el == 'image' )
246
+		elseif ($this->feed_type == RSS and $this->current_namespace == '' and $el == 'image')
247 247
 		{
248 248
 			$this->inimage = false;
249 249
 		}
250
-		elseif ($this->feed_type == ATOM and in_array($el, $this->_CONTENT_CONSTRUCTS) )
250
+		elseif ($this->feed_type == ATOM and in_array($el, $this->_CONTENT_CONSTRUCTS))
251 251
 		{
252 252
 			$this->incontent = false;
253 253
 		}
254
-		elseif ($el == 'channel' or $el == 'feed' )
254
+		elseif ($el == 'channel' or $el == 'feed')
255 255
 		{
256 256
 			$this->inchannel = false;
257 257
 		}
258
-		elseif ($this->feed_type == ATOM and $this->incontent  ) {
258
+		elseif ($this->feed_type == ATOM and $this->incontent) {
259 259
 			// balance tags properly
260 260
 			// note: This may not actually be necessary
261
-			if ( $this->stack[0] == $el )
261
+			if ($this->stack[0] == $el)
262 262
 			{
263 263
 				$this->append_content("</$el>");
264 264
 			}
@@ -266,97 +266,97 @@  discard block
 block discarded – undo
266 266
 				$this->append_content("<$el />");
267 267
 			}
268 268
 
269
-			array_shift( $this->stack );
269
+			array_shift($this->stack);
270 270
 		}
271 271
 		else {
272
-			array_shift( $this->stack );
272
+			array_shift($this->stack);
273 273
 		}
274 274
 
275 275
 		$this->current_namespace = false;
276 276
 	}
277 277
 
278
-	function concat (&$str1, $str2="") {
279
-		if (!isset($str1) ) {
280
-			$str1="";
278
+	function concat(&$str1, $str2 = "") {
279
+		if ( ! isset($str1)) {
280
+			$str1 = "";
281 281
 		}
282 282
 		$str1 .= $str2;
283 283
 	}
284 284
 
285 285
 	function append_content($text) {
286
-		if ( $this->initem ) {
287
-			$this->concat( $this->current_item[ $this->incontent ], $text );
286
+		if ($this->initem) {
287
+			$this->concat($this->current_item[$this->incontent], $text);
288 288
 		}
289
-		elseif ( $this->inchannel ) {
290
-			$this->concat( $this->channel[ $this->incontent ], $text );
289
+		elseif ($this->inchannel) {
290
+			$this->concat($this->channel[$this->incontent], $text);
291 291
 		}
292 292
 	}
293 293
 
294 294
 	// smart append - field and namespace aware
295 295
 	function append($el, $text) {
296
-		if (!$el) {
296
+		if ( ! $el) {
297 297
 			return;
298 298
 		}
299
-		if ( $this->current_namespace )
299
+		if ($this->current_namespace)
300 300
 		{
301
-			if ( $this->initem ) {
301
+			if ($this->initem) {
302 302
 				$this->concat(
303
-					$this->current_item[ $this->current_namespace ][ $el ], $text);
303
+					$this->current_item[$this->current_namespace][$el], $text);
304 304
 			}
305 305
 			elseif ($this->inchannel) {
306 306
 				$this->concat(
307
-					$this->channel[ $this->current_namespace][ $el ], $text );
307
+					$this->channel[$this->current_namespace][$el], $text );
308 308
 			}
309 309
 			elseif ($this->intextinput) {
310 310
 				$this->concat(
311
-					$this->textinput[ $this->current_namespace][ $el ], $text );
311
+					$this->textinput[$this->current_namespace][$el], $text );
312 312
 			}
313 313
 			elseif ($this->inimage) {
314 314
 				$this->concat(
315
-					$this->image[ $this->current_namespace ][ $el ], $text );
315
+					$this->image[$this->current_namespace][$el], $text );
316 316
 			}
317 317
 		}
318 318
 		else {
319
-			if ( $this->initem ) {
319
+			if ($this->initem) {
320 320
 				$this->concat(
321
-					$this->current_item[ $el ], $text);
321
+					$this->current_item[$el], $text);
322 322
 			}
323 323
 			elseif ($this->intextinput) {
324 324
 				$this->concat(
325
-					$this->textinput[ $el ], $text );
325
+					$this->textinput[$el], $text );
326 326
 			}
327 327
 			elseif ($this->inimage) {
328 328
 				$this->concat(
329
-					$this->image[ $el ], $text );
329
+					$this->image[$el], $text );
330 330
 			}
331 331
 			elseif ($this->inchannel) {
332 332
 				$this->concat(
333
-					$this->channel[ $el ], $text );
333
+					$this->channel[$el], $text );
334 334
 			}
335 335
 
336 336
 		}
337 337
 	}
338 338
 
339
-	function normalize () {
339
+	function normalize() {
340 340
 		// if atom populate rss fields
341
-		if ( $this->is_atom() ) {
341
+		if ($this->is_atom()) {
342 342
 			$this->channel['descripton'] = $this->channel['tagline'];
343
-			for ( $i = 0; $i < count($this->items); $i++) {
343
+			for ($i = 0; $i < count($this->items); $i++) {
344 344
 				$item = $this->items[$i];
345
-				if ( isset($item['summary']) )
345
+				if (isset($item['summary']))
346 346
 					$item['description'] = $item['summary'];
347
-				if ( isset($item['atom_content']))
347
+				if (isset($item['atom_content']))
348 348
 					$item['content']['encoded'] = $item['atom_content'];
349 349
 
350 350
 				$this->items[$i] = $item;
351 351
 			}
352 352
 		}
353
-		elseif ( $this->is_rss() ) {
353
+		elseif ($this->is_rss()) {
354 354
 			$this->channel['tagline'] = $this->channel['description'];
355
-			for ( $i = 0; $i < count($this->items); $i++) {
355
+			for ($i = 0; $i < count($this->items); $i++) {
356 356
 				$item = $this->items[$i];
357
-				if ( isset($item['description']))
357
+				if (isset($item['description']))
358 358
 					$item['summary'] = $item['description'];
359
-				if ( isset($item['content']['encoded'] ) )
359
+				if (isset($item['content']['encoded']))
360 360
 					$item['atom_content'] = $item['content']['encoded'];
361 361
 
362 362
 				$this->items[$i] = $item;
@@ -364,8 +364,8 @@  discard block
 block discarded – undo
364 364
 		}
365 365
 	}
366 366
 
367
-	function is_rss () {
368
-		if ( $this->feed_type == RSS ) {
367
+	function is_rss() {
368
+		if ($this->feed_type == RSS) {
369 369
 			return $this->feed_version;
370 370
 		}
371 371
 		else {
@@ -374,7 +374,7 @@  discard block
 block discarded – undo
374 374
 	}
375 375
 
376 376
 	function is_atom() {
377
-		if ( $this->feed_type == ATOM ) {
377
+		if ($this->feed_type == ATOM) {
378 378
 			return $this->feed_version;
379 379
 		}
380 380
 		else {
@@ -386,21 +386,21 @@  discard block
 block discarded – undo
386 386
 		return "$k=\"$v\"";
387 387
 	}
388 388
 
389
-	function error( $errormsg, $lvl = E_USER_WARNING ) {
389
+	function error($errormsg, $lvl = E_USER_WARNING) {
390 390
 		// append PHP's error message if track_errors enabled
391
-		if ( isset($php_errormsg) ) {
391
+		if (isset($php_errormsg)) {
392 392
 			$errormsg .= " ($php_errormsg)";
393 393
 		}
394
-		if ( MAGPIE_DEBUG ) {
395
-			trigger_error( $errormsg, $lvl);
394
+		if (MAGPIE_DEBUG) {
395
+			trigger_error($errormsg, $lvl);
396 396
 		} else {
397
-			error_log( $errormsg, 0);
397
+			error_log($errormsg, 0);
398 398
 		}
399 399
 	}
400 400
 
401 401
 }
402 402
 
403
-if ( !function_exists('fetch_rss') ) :
403
+if ( ! function_exists('fetch_rss')) :
404 404
 /**
405 405
  * Build Magpie object based on RSS from URL.
406 406
  *
@@ -411,21 +411,21 @@  discard block
 block discarded – undo
411 411
  * @param string $url URL to retrieve feed
412 412
  * @return bool|MagpieRSS false on failure or MagpieRSS object on success.
413 413
  */
414
-function fetch_rss ($url) {
414
+function fetch_rss($url) {
415 415
 	// initialize constants
416 416
 	init();
417 417
 
418
-	if ( !isset($url) ) {
418
+	if ( ! isset($url)) {
419 419
 		// error("fetch_rss called without a url");
420 420
 		return false;
421 421
 	}
422 422
 
423 423
 	// if cache is disabled
424
-	if ( !MAGPIE_CACHE_ON ) {
424
+	if ( ! MAGPIE_CACHE_ON) {
425 425
 		// fetch file, and parse it
426
-		$resp = _fetch_remote_file( $url );
427
-		if ( is_success( $resp->status ) ) {
428
-			return _response_to_rss( $resp );
426
+		$resp = _fetch_remote_file($url);
427
+		if (is_success($resp->status)) {
428
+			return _response_to_rss($resp);
429 429
 		}
430 430
 		else {
431 431
 			// error("Failed to fetch $url and cache is off");
@@ -440,28 +440,28 @@  discard block
 block discarded – undo
440 440
 		// 3. if cached obj fails freshness check, fetch remote
441 441
 		// 4. if remote fails, return stale object, or error
442 442
 
443
-		$cache = new RSSCache( MAGPIE_CACHE_DIR, MAGPIE_CACHE_AGE );
443
+		$cache = new RSSCache(MAGPIE_CACHE_DIR, MAGPIE_CACHE_AGE);
444 444
 
445 445
 		if (MAGPIE_DEBUG and $cache->ERROR) {
446 446
 			debug($cache->ERROR, E_USER_WARNING);
447 447
 		}
448 448
 
449
-		$cache_status 	 = 0;		// response of check_cache
449
+		$cache_status = 0; // response of check_cache
450 450
 		$request_headers = array(); // HTTP headers to send with fetch
451
-		$rss 			 = 0;		// parsed RSS object
452
-		$errormsg		 = 0;		// errors, if any
451
+		$rss = 0; // parsed RSS object
452
+		$errormsg = 0; // errors, if any
453 453
 
454
-		if (!$cache->ERROR) {
454
+		if ( ! $cache->ERROR) {
455 455
 			// return cache HIT, MISS, or STALE
456
-			$cache_status = $cache->check_cache( $url );
456
+			$cache_status = $cache->check_cache($url);
457 457
 		}
458 458
 
459 459
 		// if object cached, and cache is fresh, return cached obj
460
-		if ( $cache_status == 'HIT' ) {
461
-			$rss = $cache->get( $url );
462
-			if ( isset($rss) and $rss ) {
460
+		if ($cache_status == 'HIT') {
461
+			$rss = $cache->get($url);
462
+			if (isset($rss) and $rss) {
463 463
 				$rss->from_cache = 1;
464
-				if ( MAGPIE_DEBUG > 1) {
464
+				if (MAGPIE_DEBUG > 1) {
465 465
 				debug("MagpieRSS: Cache HIT", E_USER_NOTICE);
466 466
 			}
467 467
 				return $rss;
@@ -471,47 +471,47 @@  discard block
 block discarded – undo
471 471
 		// else attempt a conditional get
472 472
 
473 473
 		// set up headers
474
-		if ( $cache_status == 'STALE' ) {
475
-			$rss = $cache->get( $url );
476
-			if ( isset($rss->etag) and $rss->last_modified ) {
474
+		if ($cache_status == 'STALE') {
475
+			$rss = $cache->get($url);
476
+			if (isset($rss->etag) and $rss->last_modified) {
477 477
 				$request_headers['If-None-Match'] = $rss->etag;
478 478
 				$request_headers['If-Last-Modified'] = $rss->last_modified;
479 479
 			}
480 480
 		}
481 481
 
482
-		$resp = _fetch_remote_file( $url, $request_headers );
482
+		$resp = _fetch_remote_file($url, $request_headers);
483 483
 
484 484
 		if (isset($resp) and $resp) {
485
-			if ($resp->status == '304' ) {
485
+			if ($resp->status == '304') {
486 486
 				// we have the most current copy
487
-				if ( MAGPIE_DEBUG > 1) {
487
+				if (MAGPIE_DEBUG > 1) {
488 488
 					debug("Got 304 for $url");
489 489
 				}
490 490
 				// reset cache on 304 (at minutillo insistent prodding)
491 491
 				$cache->set($url, $rss);
492 492
 				return $rss;
493 493
 			}
494
-			elseif ( is_success( $resp->status ) ) {
495
-				$rss = _response_to_rss( $resp );
496
-				if ( $rss ) {
494
+			elseif (is_success($resp->status)) {
495
+				$rss = _response_to_rss($resp);
496
+				if ($rss) {
497 497
 					if (MAGPIE_DEBUG > 1) {
498 498
 						debug("Fetch successful");
499 499
 					}
500 500
 					// add object to cache
501
-					$cache->set( $url, $rss );
501
+					$cache->set($url, $rss);
502 502
 					return $rss;
503 503
 				}
504 504
 			}
505 505
 			else {
506 506
 				$errormsg = "Failed to fetch $url. ";
507
-				if ( $resp->error ) {
507
+				if ($resp->error) {
508 508
 					# compensate for Snoopy's annoying habbit to tacking
509 509
 					# on '\n'
510 510
 					$http_error = substr($resp->error, 0, -2);
511 511
 					$errormsg .= "(HTTP Error: $http_error)";
512 512
 				}
513 513
 				else {
514
-					$errormsg .=  "(HTTP Response: " . $resp->response_code .')';
514
+					$errormsg .= "(HTTP Response: ".$resp->response_code.')';
515 515
 				}
516 516
 			}
517 517
 		}
@@ -523,7 +523,7 @@  discard block
 block discarded – undo
523 523
 
524 524
 		// attempt to return cached object
525 525
 		if ($rss) {
526
-			if ( MAGPIE_DEBUG ) {
526
+			if (MAGPIE_DEBUG) {
527 527
 				debug("Returning STALE object for $url");
528 528
 			}
529 529
 			return $rss;
@@ -549,35 +549,35 @@  discard block
 block discarded – undo
549 549
  * @param array $headers Optional. Headers to send to the URL.
550 550
  * @return Snoopy style response
551 551
  */
552
-function _fetch_remote_file($url, $headers = "" ) {
553
-	$resp = wp_safe_remote_request( $url, array( 'headers' => $headers, 'timeout' => MAGPIE_FETCH_TIME_OUT ) );
554
-	if ( is_wp_error($resp) ) {
552
+function _fetch_remote_file($url, $headers = "") {
553
+	$resp = wp_safe_remote_request($url, array('headers' => $headers, 'timeout' => MAGPIE_FETCH_TIME_OUT));
554
+	if (is_wp_error($resp)) {
555 555
 		$error = array_shift($resp->errors);
556 556
 
557 557
 		$resp = new stdClass;
558 558
 		$resp->status = 500;
559 559
 		$resp->response_code = 500;
560
-		$resp->error = $error[0] . "\n"; //\n = Snoopy compatibility
560
+		$resp->error = $error[0]."\n"; //\n = Snoopy compatibility
561 561
 		return $resp;
562 562
 	}
563 563
 
564 564
 	// Snoopy returns headers unprocessed.
565 565
 	// Also note, WP_HTTP lowercases all keys, Snoopy did not.
566 566
 	$return_headers = array();
567
-	foreach ( wp_remote_retrieve_headers( $resp ) as $key => $value ) {
568
-		if ( !is_array($value) ) {
567
+	foreach (wp_remote_retrieve_headers($resp) as $key => $value) {
568
+		if ( ! is_array($value)) {
569 569
 			$return_headers[] = "$key: $value";
570 570
 		} else {
571
-			foreach ( $value as $v )
571
+			foreach ($value as $v)
572 572
 				$return_headers[] = "$key: $v";
573 573
 		}
574 574
 	}
575 575
 
576 576
 	$response = new stdClass;
577
-	$response->status = wp_remote_retrieve_response_code( $resp );
578
-	$response->response_code = wp_remote_retrieve_response_code( $resp );
577
+	$response->status = wp_remote_retrieve_response_code($resp);
578
+	$response->response_code = wp_remote_retrieve_response_code($resp);
579 579
 	$response->headers = $return_headers;
580
-	$response->results = wp_remote_retrieve_body( $resp );
580
+	$response->results = wp_remote_retrieve_body($resp);
581 581
 
582 582
 	return $response;
583 583
 }
@@ -592,14 +592,14 @@  discard block
 block discarded – undo
592 592
  * @param array $resp
593 593
  * @return MagpieRSS|bool
594 594
  */
595
-function _response_to_rss ($resp) {
596
-	$rss = new MagpieRSS( $resp->results );
595
+function _response_to_rss($resp) {
596
+	$rss = new MagpieRSS($resp->results);
597 597
 
598 598
 	// if RSS parsed successfully
599
-	if ( $rss && (!isset($rss->ERROR) || !$rss->ERROR) ) {
599
+	if ($rss && ( ! isset($rss->ERROR) || ! $rss->ERROR)) {
600 600
 
601 601
 		// find Etag, and Last-Modified
602
-		foreach ( (array) $resp->headers as $h) {
602
+		foreach ((array) $resp->headers as $h) {
603 603
 			// 2003-03-02 - Nicola Asuni (www.tecnick.com) - fixed bug "Undefined offset: 1"
604 604
 			if (strpos($h, ": ")) {
605 605
 				list($field, $val) = explode(": ", $h, 2);
@@ -609,11 +609,11 @@  discard block
 block discarded – undo
609 609
 				$val = "";
610 610
 			}
611 611
 
612
-			if ( $field == 'etag' ) {
612
+			if ($field == 'etag') {
613 613
 				$rss->etag = $val;
614 614
 			}
615 615
 
616
-			if ( $field == 'last-modified' ) {
616
+			if ($field == 'last-modified') {
617 617
 				$rss->last_modified = $val;
618 618
 			}
619 619
 		}
@@ -624,7 +624,7 @@  discard block
 block discarded – undo
624 624
 		$errormsg = "Failed to parse RSS file.";
625 625
 
626 626
 		if ($rss) {
627
-			$errormsg .= " (" . $rss->ERROR . ")";
627
+			$errormsg .= " (".$rss->ERROR.")";
628 628
 		}
629 629
 		// error($errormsg);
630 630
 
@@ -639,95 +639,95 @@  discard block
 block discarded – undo
639 639
  * @package External
640 640
  * @subpackage MagpieRSS
641 641
  */
642
-function init () {
643
-	if ( defined('MAGPIE_INITALIZED') ) {
642
+function init() {
643
+	if (defined('MAGPIE_INITALIZED')) {
644 644
 		return;
645 645
 	}
646 646
 	else {
647 647
 		define('MAGPIE_INITALIZED', 1);
648 648
 	}
649 649
 
650
-	if ( !defined('MAGPIE_CACHE_ON') ) {
650
+	if ( ! defined('MAGPIE_CACHE_ON')) {
651 651
 		define('MAGPIE_CACHE_ON', 1);
652 652
 	}
653 653
 
654
-	if ( !defined('MAGPIE_CACHE_DIR') ) {
654
+	if ( ! defined('MAGPIE_CACHE_DIR')) {
655 655
 		define('MAGPIE_CACHE_DIR', './cache');
656 656
 	}
657 657
 
658
-	if ( !defined('MAGPIE_CACHE_AGE') ) {
659
-		define('MAGPIE_CACHE_AGE', 60*60); // one hour
658
+	if ( ! defined('MAGPIE_CACHE_AGE')) {
659
+		define('MAGPIE_CACHE_AGE', 60 * 60); // one hour
660 660
 	}
661 661
 
662
-	if ( !defined('MAGPIE_CACHE_FRESH_ONLY') ) {
662
+	if ( ! defined('MAGPIE_CACHE_FRESH_ONLY')) {
663 663
 		define('MAGPIE_CACHE_FRESH_ONLY', 0);
664 664
 	}
665 665
 
666
-		if ( !defined('MAGPIE_DEBUG') ) {
666
+		if ( ! defined('MAGPIE_DEBUG')) {
667 667
 		define('MAGPIE_DEBUG', 0);
668 668
 	}
669 669
 
670
-	if ( !defined('MAGPIE_USER_AGENT') ) {
671
-		$ua = 'WordPress/' . $GLOBALS['wp_version'];
670
+	if ( ! defined('MAGPIE_USER_AGENT')) {
671
+		$ua = 'WordPress/'.$GLOBALS['wp_version'];
672 672
 
673
-		if ( MAGPIE_CACHE_ON ) {
674
-			$ua = $ua . ')';
673
+		if (MAGPIE_CACHE_ON) {
674
+			$ua = $ua.')';
675 675
 		}
676 676
 		else {
677
-			$ua = $ua . '; No cache)';
677
+			$ua = $ua.'; No cache)';
678 678
 		}
679 679
 
680 680
 		define('MAGPIE_USER_AGENT', $ua);
681 681
 	}
682 682
 
683
-	if ( !defined('MAGPIE_FETCH_TIME_OUT') ) {
684
-		define('MAGPIE_FETCH_TIME_OUT', 2);	// 2 second timeout
683
+	if ( ! defined('MAGPIE_FETCH_TIME_OUT')) {
684
+		define('MAGPIE_FETCH_TIME_OUT', 2); // 2 second timeout
685 685
 	}
686 686
 
687 687
 	// use gzip encoding to fetch rss files if supported?
688
-	if ( !defined('MAGPIE_USE_GZIP') ) {
688
+	if ( ! defined('MAGPIE_USE_GZIP')) {
689 689
 		define('MAGPIE_USE_GZIP', true);
690 690
 	}
691 691
 }
692 692
 
693
-function is_info ($sc) {
693
+function is_info($sc) {
694 694
 	return $sc >= 100 && $sc < 200;
695 695
 }
696 696
 
697
-function is_success ($sc) {
697
+function is_success($sc) {
698 698
 	return $sc >= 200 && $sc < 300;
699 699
 }
700 700
 
701
-function is_redirect ($sc) {
701
+function is_redirect($sc) {
702 702
 	return $sc >= 300 && $sc < 400;
703 703
 }
704 704
 
705
-function is_error ($sc) {
705
+function is_error($sc) {
706 706
 	return $sc >= 400 && $sc < 600;
707 707
 }
708 708
 
709
-function is_client_error ($sc) {
709
+function is_client_error($sc) {
710 710
 	return $sc >= 400 && $sc < 500;
711 711
 }
712 712
 
713
-function is_server_error ($sc) {
713
+function is_server_error($sc) {
714 714
 	return $sc >= 500 && $sc < 600;
715 715
 }
716 716
 
717 717
 class RSSCache {
718
-	var $BASE_CACHE;	// where the cache files are stored
719
-	var $MAX_AGE	= 43200;  		// when are files stale, default twelve hours
720
-	var $ERROR 		= '';			// accumulate error messages
718
+	var $BASE_CACHE; // where the cache files are stored
719
+	var $MAX_AGE	= 43200; // when are files stale, default twelve hours
720
+	var $ERROR 		= ''; // accumulate error messages
721 721
 
722 722
 	/**
723 723
 	 * PHP5 constructor.
724 724
 	 */
725
-	function __construct( $base = '', $age = '' ) {
726
-		$this->BASE_CACHE = WP_CONTENT_DIR . '/cache';
727
-		if ( $base ) {
725
+	function __construct($base = '', $age = '') {
726
+		$this->BASE_CACHE = WP_CONTENT_DIR.'/cache';
727
+		if ($base) {
728 728
 			$this->BASE_CACHE = $base;
729 729
 		}
730
-		if ( $age ) {
730
+		if ($age) {
731 731
 			$this->MAX_AGE = $age;
732 732
 		}
733 733
 
@@ -736,8 +736,8 @@  discard block
 block discarded – undo
736 736
 	/**
737 737
 	 * PHP4 constructor.
738 738
 	 */
739
-	public function RSSCache( $base = '', $age = '' ) {
740
-		self::__construct( $base, $age );
739
+	public function RSSCache($base = '', $age = '') {
740
+		self::__construct($base, $age);
741 741
 	}
742 742
 
743 743
 /*=======================================================================*\
@@ -746,8 +746,8 @@  discard block
 block discarded – undo
746 746
 	Input:		url from wich the rss file was fetched
747 747
 	Output:		true on success
748 748
 \*=======================================================================*/
749
-	function set ($url, $rss) {
750
-		$cache_option = 'rss_' . $this->file_name( $url );
749
+	function set($url, $rss) {
750
+		$cache_option = 'rss_'.$this->file_name($url);
751 751
 
752 752
 		set_transient($cache_option, $rss, $this->MAX_AGE);
753 753
 
@@ -760,11 +760,11 @@  discard block
 block discarded – undo
760 760
 	Input:		url from wich the rss file was fetched
761 761
 	Output:		cached object on HIT, false on MISS
762 762
 \*=======================================================================*/
763
-	function get ($url) {
763
+	function get($url) {
764 764
 		$this->ERROR = "";
765
-		$cache_option = 'rss_' . $this->file_name( $url );
765
+		$cache_option = 'rss_'.$this->file_name($url);
766 766
 
767
-		if ( ! $rss = get_transient( $cache_option ) ) {
767
+		if ( ! $rss = get_transient($cache_option)) {
768 768
 			$this->debug(
769 769
 				"Cache doesn't contain: $url (cache option: $cache_option)"
770 770
 			);
@@ -781,11 +781,11 @@  discard block
 block discarded – undo
781 781
 	Input:		url from wich the rss file was fetched
782 782
 	Output:		cached object on HIT, false on MISS
783 783
 \*=======================================================================*/
784
-	function check_cache ( $url ) {
784
+	function check_cache($url) {
785 785
 		$this->ERROR = "";
786
-		$cache_option = 'rss_' . $this->file_name( $url );
786
+		$cache_option = 'rss_'.$this->file_name($url);
787 787
 
788
-		if ( get_transient($cache_option) ) {
788
+		if (get_transient($cache_option)) {
789 789
 			// object exists and is current
790 790
 				return 'HIT';
791 791
 		} else {
@@ -797,15 +797,15 @@  discard block
 block discarded – undo
797 797
 /*=======================================================================*\
798 798
 	Function:	serialize
799 799
 \*=======================================================================*/
800
-	function serialize ( $rss ) {
801
-		return serialize( $rss );
800
+	function serialize($rss) {
801
+		return serialize($rss);
802 802
 	}
803 803
 
804 804
 /*=======================================================================*\
805 805
 	Function:	unserialize
806 806
 \*=======================================================================*/
807
-	function unserialize ( $data ) {
808
-		return unserialize( $data );
807
+	function unserialize($data) {
808
+		return unserialize($data);
809 809
 	}
810 810
 
811 811
 /*=======================================================================*\
@@ -814,64 +814,64 @@  discard block
 block discarded – undo
814 814
 	Input:		url from wich the rss file was fetched
815 815
 	Output:		a file name
816 816
 \*=======================================================================*/
817
-	function file_name ($url) {
818
-		return md5( $url );
817
+	function file_name($url) {
818
+		return md5($url);
819 819
 	}
820 820
 
821 821
 /*=======================================================================*\
822 822
 	Function:	error
823 823
 	Purpose:	register error
824 824
 \*=======================================================================*/
825
-	function error ($errormsg, $lvl=E_USER_WARNING) {
825
+	function error($errormsg, $lvl = E_USER_WARNING) {
826 826
 		// append PHP's error message if track_errors enabled
827
-		if ( isset($php_errormsg) ) {
827
+		if (isset($php_errormsg)) {
828 828
 			$errormsg .= " ($php_errormsg)";
829 829
 		}
830 830
 		$this->ERROR = $errormsg;
831
-		if ( MAGPIE_DEBUG ) {
832
-			trigger_error( $errormsg, $lvl);
831
+		if (MAGPIE_DEBUG) {
832
+			trigger_error($errormsg, $lvl);
833 833
 		}
834 834
 		else {
835
-			error_log( $errormsg, 0);
835
+			error_log($errormsg, 0);
836 836
 		}
837 837
 	}
838
-			function debug ($debugmsg, $lvl=E_USER_NOTICE) {
839
-		if ( MAGPIE_DEBUG ) {
838
+			function debug($debugmsg, $lvl = E_USER_NOTICE) {
839
+		if (MAGPIE_DEBUG) {
840 840
 			$this->error("MagpieRSS [debug] $debugmsg", $lvl);
841 841
 		}
842 842
 	}
843 843
 }
844 844
 
845
-if ( !function_exists('parse_w3cdtf') ) :
846
-function parse_w3cdtf ( $date_str ) {
845
+if ( ! function_exists('parse_w3cdtf')) :
846
+function parse_w3cdtf($date_str) {
847 847
 
848 848
 	# regex to match wc3dtf
849 849
 	$pat = "/(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(:(\d{2}))?(?:([-+])(\d{2}):?(\d{2})|(Z))?/";
850 850
 
851
-	if ( preg_match( $pat, $date_str, $match ) ) {
852
-		list( $year, $month, $day, $hours, $minutes, $seconds) =
853
-			array( $match[1], $match[2], $match[3], $match[4], $match[5], $match[7]);
851
+	if (preg_match($pat, $date_str, $match)) {
852
+		list($year, $month, $day, $hours, $minutes, $seconds) =
853
+			array($match[1], $match[2], $match[3], $match[4], $match[5], $match[7]);
854 854
 
855 855
 		# calc epoch for current date assuming GMT
856
-		$epoch = gmmktime( $hours, $minutes, $seconds, $month, $day, $year);
856
+		$epoch = gmmktime($hours, $minutes, $seconds, $month, $day, $year);
857 857
 
858 858
 		$offset = 0;
859
-		if ( $match[11] == 'Z' ) {
859
+		if ($match[11] == 'Z') {
860 860
 			# zulu time, aka GMT
861 861
 		}
862 862
 		else {
863
-			list( $tz_mod, $tz_hour, $tz_min ) =
864
-				array( $match[8], $match[9], $match[10]);
863
+			list($tz_mod, $tz_hour, $tz_min) =
864
+				array($match[8], $match[9], $match[10]);
865 865
 
866 866
 			# zero out the variables
867
-			if ( ! $tz_hour ) { $tz_hour = 0; }
868
-			if ( ! $tz_min ) { $tz_min = 0; }
867
+			if ( ! $tz_hour) { $tz_hour = 0; }
868
+			if ( ! $tz_min) { $tz_min = 0; }
869 869
 
870
-			$offset_secs = (($tz_hour*60)+$tz_min)*60;
870
+			$offset_secs = (($tz_hour * 60) + $tz_min) * 60;
871 871
 
872 872
 			# is timezone ahead of GMT?  then subtract offset
873 873
 			#
874
-			if ( $tz_mod == '+' ) {
874
+			if ($tz_mod == '+') {
875 875
 				$offset_secs = $offset_secs * -1;
876 876
 			}
877 877
 
@@ -886,7 +886,7 @@  discard block
 block discarded – undo
886 886
 }
887 887
 endif;
888 888
 
889
-if ( !function_exists('wp_rss') ) :
889
+if ( ! function_exists('wp_rss')) :
890 890
 /**
891 891
  * Display all RSS items in a HTML ordered list.
892 892
  *
@@ -897,31 +897,31 @@  discard block
 block discarded – undo
897 897
  * @param string $url URL of feed to display. Will not auto sense feed URL.
898 898
  * @param int $num_items Optional. Number of items to display, default is all.
899 899
  */
900
-function wp_rss( $url, $num_items = -1 ) {
901
-	if ( $rss = fetch_rss( $url ) ) {
900
+function wp_rss($url, $num_items = -1) {
901
+	if ($rss = fetch_rss($url)) {
902 902
 		echo '<ul>';
903 903
 
904
-		if ( $num_items !== -1 ) {
905
-			$rss->items = array_slice( $rss->items, 0, $num_items );
904
+		if ($num_items !== -1) {
905
+			$rss->items = array_slice($rss->items, 0, $num_items);
906 906
 		}
907 907
 
908
-		foreach ( (array) $rss->items as $item ) {
908
+		foreach ((array) $rss->items as $item) {
909 909
 			printf(
910 910
 				'<li><a href="%1$s" title="%2$s">%3$s</a></li>',
911
-				esc_url( $item['link'] ),
912
-				esc_attr( strip_tags( $item['description'] ) ),
913
-				esc_html( $item['title'] )
911
+				esc_url($item['link']),
912
+				esc_attr(strip_tags($item['description'])),
913
+				esc_html($item['title'])
914 914
 			);
915 915
 		}
916 916
 
917 917
 		echo '</ul>';
918 918
 	} else {
919
-		_e( 'An error has occurred, which probably means the feed is down. Try again later.' );
919
+		_e('An error has occurred, which probably means the feed is down. Try again later.');
920 920
 	}
921 921
 }
922 922
 endif;
923 923
 
924
-if ( !function_exists('get_rss') ) :
924
+if ( ! function_exists('get_rss')) :
925 925
 /**
926 926
  * Display RSS items in HTML list items.
927 927
  *
@@ -938,11 +938,11 @@  discard block
 block discarded – undo
938 938
  * @param int $num_items Optional. Number of items to display, default is all.
939 939
  * @return bool False on failure.
940 940
  */
941
-function get_rss ($url, $num_items = 5) { // Like get posts, but for RSS
941
+function get_rss($url, $num_items = 5) { // Like get posts, but for RSS
942 942
 	$rss = fetch_rss($url);
943
-	if ( $rss ) {
943
+	if ($rss) {
944 944
 		$rss->items = array_slice($rss->items, 0, $num_items);
945
-		foreach ( (array) $rss->items as $item ) {
945
+		foreach ((array) $rss->items as $item) {
946 946
 			echo "<li>\n";
947 947
 			echo "<a href='$item[link]' title='$item[description]'>";
948 948
 			echo esc_html($item['title']);
Please login to merge, or discard this patch.
Braces   +56 added lines, -85 removed lines patch added patch discarded remove patch
@@ -62,13 +62,15 @@  discard block
 block discarded – undo
62 62
 
63 63
 		# if PHP xml isn't compiled in, die
64 64
 		#
65
-		if ( !function_exists('xml_parser_create') )
66
-			trigger_error( "Failed to load PHP's XML Extension. https://secure.php.net/manual/en/ref.xml.php" );
65
+		if ( !function_exists('xml_parser_create') ) {
66
+					trigger_error( "Failed to load PHP's XML Extension. https://secure.php.net/manual/en/ref.xml.php" );
67
+		}
67 68
 
68 69
 		$parser = @xml_parser_create();
69 70
 
70
-		if ( !is_resource($parser) )
71
-			trigger_error( "Failed to create an instance of PHP's XML parser. https://secure.php.net/manual/en/ref.xml.php");
71
+		if ( !is_resource($parser) ) {
72
+					trigger_error( "Failed to create an instance of PHP's XML parser. https://secure.php.net/manual/en/ref.xml.php");
73
+		}
72 74
 
73 75
 		$this->parser = $parser;
74 76
 
@@ -127,12 +129,10 @@  discard block
 block discarded – undo
127 129
 			if ( $el == 'rdf' ) {
128 130
 				$this->feed_type = RSS;
129 131
 				$this->feed_version = '1.0';
130
-			}
131
-			elseif ( $el == 'rss' ) {
132
+			} elseif ( $el == 'rss' ) {
132 133
 				$this->feed_type = RSS;
133 134
 				$this->feed_version = $attrs['version'];
134
-			}
135
-			elseif ( $el == 'feed' ) {
135
+			} elseif ( $el == 'feed' ) {
136 136
 				$this->feed_type = ATOM;
137 137
 				$this->feed_version = $attrs['version'];
138 138
 				$this->inchannel = true;
@@ -143,8 +143,7 @@  discard block
 block discarded – undo
143 143
 		if ( $el == 'channel' )
144 144
 		{
145 145
 			$this->inchannel = true;
146
-		}
147
-		elseif ($el == 'item' or $el == 'entry' )
146
+		} elseif ($el == 'item' or $el == 'entry' )
148 147
 		{
149 148
 			$this->initem = true;
150 149
 			if ( isset($attrs['rdf:about']) ) {
@@ -160,9 +159,7 @@  discard block
 block discarded – undo
160 159
 			$el == 'textinput' )
161 160
 		{
162 161
 			$this->intextinput = true;
163
-		}
164
-
165
-		elseif (
162
+		} elseif (
166 163
 			$this->feed_type == RSS and
167 164
 			$this->current_namespace == '' and
168 165
 			$el == 'image' )
@@ -205,8 +202,7 @@  discard block
 block discarded – undo
205 202
 			if ( isset($attrs['rel']) and $attrs['rel'] == 'alternate' )
206 203
 			{
207 204
 				$link_el = 'link';
208
-			}
209
-			else {
205
+			} else {
210 206
 				$link_el = 'link_' . $attrs['rel'];
211 207
 			}
212 208
 
@@ -223,8 +219,7 @@  discard block
 block discarded – undo
223 219
 		if ($this->feed_type == ATOM and $this->incontent)
224 220
 		{
225 221
 			$this->append_content( $text );
226
-		}
227
-		else {
222
+		} else {
228 223
 			$current_el = join('_', array_reverse($this->stack));
229 224
 			$this->append($current_el, $text);
230 225
 		}
@@ -238,37 +233,30 @@  discard block
 block discarded – undo
238 233
 			$this->items[] = $this->current_item;
239 234
 			$this->current_item = array();
240 235
 			$this->initem = false;
241
-		}
242
-		elseif ($this->feed_type == RSS and $this->current_namespace == '' and $el == 'textinput' )
236
+		} elseif ($this->feed_type == RSS and $this->current_namespace == '' and $el == 'textinput' )
243 237
 		{
244 238
 			$this->intextinput = false;
245
-		}
246
-		elseif ($this->feed_type == RSS and $this->current_namespace == '' and $el == 'image' )
239
+		} elseif ($this->feed_type == RSS and $this->current_namespace == '' and $el == 'image' )
247 240
 		{
248 241
 			$this->inimage = false;
249
-		}
250
-		elseif ($this->feed_type == ATOM and in_array($el, $this->_CONTENT_CONSTRUCTS) )
242
+		} elseif ($this->feed_type == ATOM and in_array($el, $this->_CONTENT_CONSTRUCTS) )
251 243
 		{
252 244
 			$this->incontent = false;
253
-		}
254
-		elseif ($el == 'channel' or $el == 'feed' )
245
+		} elseif ($el == 'channel' or $el == 'feed' )
255 246
 		{
256 247
 			$this->inchannel = false;
257
-		}
258
-		elseif ($this->feed_type == ATOM and $this->incontent  ) {
248
+		} elseif ($this->feed_type == ATOM and $this->incontent  ) {
259 249
 			// balance tags properly
260 250
 			// note: This may not actually be necessary
261 251
 			if ( $this->stack[0] == $el )
262 252
 			{
263 253
 				$this->append_content("</$el>");
264
-			}
265
-			else {
254
+			} else {
266 255
 				$this->append_content("<$el />");
267 256
 			}
268 257
 
269 258
 			array_shift( $this->stack );
270
-		}
271
-		else {
259
+		} else {
272 260
 			array_shift( $this->stack );
273 261
 		}
274 262
 
@@ -285,8 +273,7 @@  discard block
 block discarded – undo
285 273
 	function append_content($text) {
286 274
 		if ( $this->initem ) {
287 275
 			$this->concat( $this->current_item[ $this->incontent ], $text );
288
-		}
289
-		elseif ( $this->inchannel ) {
276
+		} elseif ( $this->inchannel ) {
290 277
 			$this->concat( $this->channel[ $this->incontent ], $text );
291 278
 		}
292 279
 	}
@@ -301,34 +288,27 @@  discard block
 block discarded – undo
301 288
 			if ( $this->initem ) {
302 289
 				$this->concat(
303 290
 					$this->current_item[ $this->current_namespace ][ $el ], $text);
304
-			}
305
-			elseif ($this->inchannel) {
291
+			} elseif ($this->inchannel) {
306 292
 				$this->concat(
307 293
 					$this->channel[ $this->current_namespace][ $el ], $text );
308
-			}
309
-			elseif ($this->intextinput) {
294
+			} elseif ($this->intextinput) {
310 295
 				$this->concat(
311 296
 					$this->textinput[ $this->current_namespace][ $el ], $text );
312
-			}
313
-			elseif ($this->inimage) {
297
+			} elseif ($this->inimage) {
314 298
 				$this->concat(
315 299
 					$this->image[ $this->current_namespace ][ $el ], $text );
316 300
 			}
317
-		}
318
-		else {
301
+		} else {
319 302
 			if ( $this->initem ) {
320 303
 				$this->concat(
321 304
 					$this->current_item[ $el ], $text);
322
-			}
323
-			elseif ($this->intextinput) {
305
+			} elseif ($this->intextinput) {
324 306
 				$this->concat(
325 307
 					$this->textinput[ $el ], $text );
326
-			}
327
-			elseif ($this->inimage) {
308
+			} elseif ($this->inimage) {
328 309
 				$this->concat(
329 310
 					$this->image[ $el ], $text );
330
-			}
331
-			elseif ($this->inchannel) {
311
+			} elseif ($this->inchannel) {
332 312
 				$this->concat(
333 313
 					$this->channel[ $el ], $text );
334 314
 			}
@@ -342,22 +322,25 @@  discard block
 block discarded – undo
342 322
 			$this->channel['descripton'] = $this->channel['tagline'];
343 323
 			for ( $i = 0; $i < count($this->items); $i++) {
344 324
 				$item = $this->items[$i];
345
-				if ( isset($item['summary']) )
346
-					$item['description'] = $item['summary'];
347
-				if ( isset($item['atom_content']))
348
-					$item['content']['encoded'] = $item['atom_content'];
325
+				if ( isset($item['summary']) ) {
326
+									$item['description'] = $item['summary'];
327
+				}
328
+				if ( isset($item['atom_content'])) {
329
+									$item['content']['encoded'] = $item['atom_content'];
330
+				}
349 331
 
350 332
 				$this->items[$i] = $item;
351 333
 			}
352
-		}
353
-		elseif ( $this->is_rss() ) {
334
+		} elseif ( $this->is_rss() ) {
354 335
 			$this->channel['tagline'] = $this->channel['description'];
355 336
 			for ( $i = 0; $i < count($this->items); $i++) {
356 337
 				$item = $this->items[$i];
357
-				if ( isset($item['description']))
358
-					$item['summary'] = $item['description'];
359
-				if ( isset($item['content']['encoded'] ) )
360
-					$item['atom_content'] = $item['content']['encoded'];
338
+				if ( isset($item['description'])) {
339
+									$item['summary'] = $item['description'];
340
+				}
341
+				if ( isset($item['content']['encoded'] ) ) {
342
+									$item['atom_content'] = $item['content']['encoded'];
343
+				}
361 344
 
362 345
 				$this->items[$i] = $item;
363 346
 			}
@@ -367,8 +350,7 @@  discard block
 block discarded – undo
367 350
 	function is_rss () {
368 351
 		if ( $this->feed_type == RSS ) {
369 352
 			return $this->feed_version;
370
-		}
371
-		else {
353
+		} else {
372 354
 			return false;
373 355
 		}
374 356
 	}
@@ -376,8 +358,7 @@  discard block
 block discarded – undo
376 358
 	function is_atom() {
377 359
 		if ( $this->feed_type == ATOM ) {
378 360
 			return $this->feed_version;
379
-		}
380
-		else {
361
+		} else {
381 362
 			return false;
382 363
 		}
383 364
 	}
@@ -426,8 +407,7 @@  discard block
 block discarded – undo
426 407
 		$resp = _fetch_remote_file( $url );
427 408
 		if ( is_success( $resp->status ) ) {
428 409
 			return _response_to_rss( $resp );
429
-		}
430
-		else {
410
+		} else {
431 411
 			// error("Failed to fetch $url and cache is off");
432 412
 			return false;
433 413
 		}
@@ -490,8 +470,7 @@  discard block
 block discarded – undo
490 470
 				// reset cache on 304 (at minutillo insistent prodding)
491 471
 				$cache->set($url, $rss);
492 472
 				return $rss;
493
-			}
494
-			elseif ( is_success( $resp->status ) ) {
473
+			} elseif ( is_success( $resp->status ) ) {
495 474
 				$rss = _response_to_rss( $resp );
496 475
 				if ( $rss ) {
497 476
 					if (MAGPIE_DEBUG > 1) {
@@ -501,21 +480,18 @@  discard block
 block discarded – undo
501 480
 					$cache->set( $url, $rss );
502 481
 					return $rss;
503 482
 				}
504
-			}
505
-			else {
483
+			} else {
506 484
 				$errormsg = "Failed to fetch $url. ";
507 485
 				if ( $resp->error ) {
508 486
 					# compensate for Snoopy's annoying habbit to tacking
509 487
 					# on '\n'
510 488
 					$http_error = substr($resp->error, 0, -2);
511 489
 					$errormsg .= "(HTTP Error: $http_error)";
512
-				}
513
-				else {
490
+				} else {
514 491
 					$errormsg .=  "(HTTP Response: " . $resp->response_code .')';
515 492
 				}
516 493
 			}
517
-		}
518
-		else {
494
+		} else {
519 495
 			$errormsg = "Unable to retrieve RSS file for unknown reasons.";
520 496
 		}
521 497
 
@@ -568,8 +544,9 @@  discard block
 block discarded – undo
568 544
 		if ( !is_array($value) ) {
569 545
 			$return_headers[] = "$key: $value";
570 546
 		} else {
571
-			foreach ( $value as $v )
572
-				$return_headers[] = "$key: $v";
547
+			foreach ( $value as $v ) {
548
+							$return_headers[] = "$key: $v";
549
+			}
573 550
 		}
574 551
 	}
575 552
 
@@ -603,8 +580,7 @@  discard block
 block discarded – undo
603 580
 			// 2003-03-02 - Nicola Asuni (www.tecnick.com) - fixed bug "Undefined offset: 1"
604 581
 			if (strpos($h, ": ")) {
605 582
 				list($field, $val) = explode(": ", $h, 2);
606
-			}
607
-			else {
583
+			} else {
608 584
 				$field = $h;
609 585
 				$val = "";
610 586
 			}
@@ -642,8 +618,7 @@  discard block
 block discarded – undo
642 618
 function init () {
643 619
 	if ( defined('MAGPIE_INITALIZED') ) {
644 620
 		return;
645
-	}
646
-	else {
621
+	} else {
647 622
 		define('MAGPIE_INITALIZED', 1);
648 623
 	}
649 624
 
@@ -672,8 +647,7 @@  discard block
 block discarded – undo
672 647
 
673 648
 		if ( MAGPIE_CACHE_ON ) {
674 649
 			$ua = $ua . ')';
675
-		}
676
-		else {
650
+		} else {
677 651
 			$ua = $ua . '; No cache)';
678 652
 		}
679 653
 
@@ -830,8 +804,7 @@  discard block
 block discarded – undo
830 804
 		$this->ERROR = $errormsg;
831 805
 		if ( MAGPIE_DEBUG ) {
832 806
 			trigger_error( $errormsg, $lvl);
833
-		}
834
-		else {
807
+		} else {
835 808
 			error_log( $errormsg, 0);
836 809
 		}
837 810
 	}
@@ -858,8 +831,7 @@  discard block
 block discarded – undo
858 831
 		$offset = 0;
859 832
 		if ( $match[11] == 'Z' ) {
860 833
 			# zulu time, aka GMT
861
-		}
862
-		else {
834
+		} else {
863 835
 			list( $tz_mod, $tz_hour, $tz_min ) =
864 836
 				array( $match[8], $match[9], $match[10]);
865 837
 
@@ -879,8 +851,7 @@  discard block
 block discarded – undo
879 851
 		}
880 852
 		$epoch = $epoch + $offset;
881 853
 		return $epoch;
882
-	}
883
-	else {
854
+	} else {
884 855
 		return -1;
885 856
 	}
886 857
 }
Please login to merge, or discard this patch.
src/wp-includes/SimplePie/Decode/HTML/Entities.php 3 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
 	 * Consume the next byte
110 110
 	 *
111 111
 	 * @access private
112
-	 * @return mixed The next byte, or false, if there is no more data
112
+	 * @return string|false The next byte, or false, if there is no more data
113 113
 	 */
114 114
 	public function consume()
115 115
 	{
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
 	 *
130 130
 	 * @access private
131 131
 	 * @param string $chars Characters to consume
132
-	 * @return mixed A series of characters that match the range, or false
132
+	 * @return string|false A series of characters that match the range, or false
133 133
 	 */
134 134
 	public function consume_range($chars)
135 135
 	{
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -215,7 +215,7 @@
 block discarded – undo
215 215
 						$replacement = SimplePie_Misc::codepoint_to_utf8($codepoint);
216 216
 					}
217 217
 
218
-					if (!in_array($this->consume(), array(';', false), true))
218
+					if ( ! in_array($this->consume(), array(';', false), true))
219 219
 					{
220 220
 						$this->unconsume();
221 221
 					}
Please login to merge, or discard this patch.
Braces   +4 added lines, -8 removed lines patch added patch discarded remove patch
@@ -117,8 +117,7 @@  discard block
 block discarded – undo
117 117
 		{
118 118
 			$this->consumed .= $this->data[$this->position];
119 119
 			return $this->data[$this->position++];
120
-		}
121
-		else
120
+		} else
122 121
 		{
123 122
 			return false;
124 123
 		}
@@ -139,8 +138,7 @@  discard block
 block discarded – undo
139 138
 			$this->consumed .= $data;
140 139
 			$this->position += $len;
141 140
 			return $data;
142
-		}
143
-		else
141
+		} else
144 142
 		{
145 143
 			return false;
146 144
 		}
@@ -200,8 +198,7 @@  discard block
 block discarded – undo
200 198
 					if ($hex)
201 199
 					{
202 200
 						$codepoint = hexdec($codepoint);
203
-					}
204
-					else
201
+					} else
205 202
 					{
206 203
 						$codepoint = intval($codepoint);
207 204
 					}
@@ -209,8 +206,7 @@  discard block
 block discarded – undo
209 206
 					if (isset($windows_1252_specials[$codepoint]))
210 207
 					{
211 208
 						$replacement = $windows_1252_specials[$codepoint];
212
-					}
213
-					else
209
+					} else
214 210
 					{
215 211
 						$replacement = SimplePie_Misc::codepoint_to_utf8($codepoint);
216 212
 					}
Please login to merge, or discard this patch.
src/wp-includes/SimplePie/Enclosure.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -647,7 +647,7 @@
 block discarded – undo
647 647
 	/**
648 648
 	 * Get length
649 649
 	 *
650
-	 * @return float Length in bytes
650
+	 * @return string|null Length in bytes
651 651
 	 */
652 652
 	public function get_length()
653 653
 	{
Please login to merge, or discard this patch.
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -813,7 +813,7 @@  discard block
 block discarded – undo
813 813
 		$length = $this->get_length();
814 814
 		if ($length !== null)
815 815
 		{
816
-			return round($length/1048576, 2);
816
+			return round($length / 1048576, 2);
817 817
 		}
818 818
 		else
819 819
 		{
@@ -917,7 +917,7 @@  discard block
 block discarded – undo
917 917
 	 * @param array|string $options See first paramter to {@see embed}
918 918
 	 * @return string HTML string to output
919 919
 	 */
920
-	public function native_embed($options='')
920
+	public function native_embed($options = '')
921 921
 	{
922 922
 		return $this->embed($options, true);
923 923
 	}
@@ -991,7 +991,7 @@  discard block
 block discarded – undo
991 991
 		else
992 992
 		{
993 993
 			$options = explode(',', $options);
994
-			foreach($options as $option)
994
+			foreach ($options as $option)
995 995
 			{
996 996
 				$opt = explode(':', $option, 2);
997 997
 				if (isset($opt[0], $opt[1]))
@@ -1058,11 +1058,11 @@  discard block
 block discarded – undo
1058 1058
 				}
1059 1059
 				elseif ($widescreen)
1060 1060
 				{
1061
-					$width = round((intval($height)/9)*16);
1061
+					$width = round((intval($height) / 9) * 16);
1062 1062
 				}
1063 1063
 				else
1064 1064
 				{
1065
-					$width = round((intval($height)/3)*4);
1065
+					$width = round((intval($height) / 3) * 4);
1066 1066
 				}
1067 1067
 			}
1068 1068
 			else
@@ -1092,11 +1092,11 @@  discard block
 block discarded – undo
1092 1092
 				}
1093 1093
 				elseif ($widescreen)
1094 1094
 				{
1095
-					$height = round((intval($width)/16)*9);
1095
+					$height = round((intval($width) / 16) * 9);
1096 1096
 				}
1097 1097
 				else
1098 1098
 				{
1099
-					$height = round((intval($width)/4)*3);
1099
+					$height = round((intval($width) / 4) * 3);
1100 1100
 				}
1101 1101
 			}
1102 1102
 			else
@@ -1126,11 +1126,11 @@  discard block
 block discarded – undo
1126 1126
 		{
1127 1127
 			if ($native)
1128 1128
 			{
1129
-				$embed .= "<embed src=\"" . $this->get_link() . "\" pluginspage=\"http://adobe.com/go/getflashplayer\" type=\"$type\" quality=\"high\" width=\"$width\" height=\"$height\" bgcolor=\"$bgcolor\" loop=\"$loop\"></embed>";
1129
+				$embed .= "<embed src=\"".$this->get_link()."\" pluginspage=\"http://adobe.com/go/getflashplayer\" type=\"$type\" quality=\"high\" width=\"$width\" height=\"$height\" bgcolor=\"$bgcolor\" loop=\"$loop\"></embed>";
1130 1130
 			}
1131 1131
 			else
1132 1132
 			{
1133
-				$embed .= "<script type='text/javascript'>embed_flash('$bgcolor', '$width', '$height', '" . $this->get_link() . "', '$loop', '$type');</script>";
1133
+				$embed .= "<script type='text/javascript'>embed_flash('$bgcolor', '$width', '$height', '".$this->get_link()."', '$loop', '$type');</script>";
1134 1134
 			}
1135 1135
 		}
1136 1136
 
@@ -1141,11 +1141,11 @@  discard block
 block discarded – undo
1141 1141
 			$height += 20;
1142 1142
 			if ($native)
1143 1143
 			{
1144
-				$embed .= "<embed src=\"$mediaplayer\" pluginspage=\"http://adobe.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" quality=\"high\" width=\"$width\" height=\"$height\" wmode=\"transparent\" flashvars=\"file=" . rawurlencode($this->get_link().'?file_extension=.'.$this->get_extension()) . "&autostart=false&repeat=$loop&showdigits=true&showfsbutton=false\"></embed>";
1144
+				$embed .= "<embed src=\"$mediaplayer\" pluginspage=\"http://adobe.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" quality=\"high\" width=\"$width\" height=\"$height\" wmode=\"transparent\" flashvars=\"file=".rawurlencode($this->get_link().'?file_extension=.'.$this->get_extension())."&autostart=false&repeat=$loop&showdigits=true&showfsbutton=false\"></embed>";
1145 1145
 			}
1146 1146
 			else
1147 1147
 			{
1148
-				$embed .= "<script type='text/javascript'>embed_flv('$width', '$height', '" . rawurlencode($this->get_link().'?file_extension=.'.$this->get_extension()) . "', '$placeholder', '$loop', '$mediaplayer');</script>";
1148
+				$embed .= "<script type='text/javascript'>embed_flv('$width', '$height', '".rawurlencode($this->get_link().'?file_extension=.'.$this->get_extension())."', '$placeholder', '$loop', '$mediaplayer');</script>";
1149 1149
 			}
1150 1150
 		}
1151 1151
 
@@ -1158,16 +1158,16 @@  discard block
 block discarded – undo
1158 1158
 			{
1159 1159
 				if ($placeholder !== '')
1160 1160
 				{
1161
-					$embed .= "<embed type=\"$type\" style=\"cursor:hand; cursor:pointer;\" href=\"" . $this->get_link() . "\" src=\"$placeholder\" width=\"$width\" height=\"$height\" autoplay=\"false\" target=\"myself\" controller=\"false\" loop=\"$loop\" scale=\"aspect\" bgcolor=\"$bgcolor\" pluginspage=\"http://apple.com/quicktime/download/\"></embed>";
1161
+					$embed .= "<embed type=\"$type\" style=\"cursor:hand; cursor:pointer;\" href=\"".$this->get_link()."\" src=\"$placeholder\" width=\"$width\" height=\"$height\" autoplay=\"false\" target=\"myself\" controller=\"false\" loop=\"$loop\" scale=\"aspect\" bgcolor=\"$bgcolor\" pluginspage=\"http://apple.com/quicktime/download/\"></embed>";
1162 1162
 				}
1163 1163
 				else
1164 1164
 				{
1165
-					$embed .= "<embed type=\"$type\" style=\"cursor:hand; cursor:pointer;\" src=\"" . $this->get_link() . "\" width=\"$width\" height=\"$height\" autoplay=\"false\" target=\"myself\" controller=\"true\" loop=\"$loop\" scale=\"aspect\" bgcolor=\"$bgcolor\" pluginspage=\"http://apple.com/quicktime/download/\"></embed>";
1165
+					$embed .= "<embed type=\"$type\" style=\"cursor:hand; cursor:pointer;\" src=\"".$this->get_link()."\" width=\"$width\" height=\"$height\" autoplay=\"false\" target=\"myself\" controller=\"true\" loop=\"$loop\" scale=\"aspect\" bgcolor=\"$bgcolor\" pluginspage=\"http://apple.com/quicktime/download/\"></embed>";
1166 1166
 				}
1167 1167
 			}
1168 1168
 			else
1169 1169
 			{
1170
-				$embed .= "<script type='text/javascript'>embed_quicktime('$type', '$bgcolor', '$width', '$height', '" . $this->get_link() . "', '$placeholder', '$loop');</script>";
1170
+				$embed .= "<script type='text/javascript'>embed_quicktime('$type', '$bgcolor', '$width', '$height', '".$this->get_link()."', '$placeholder', '$loop');</script>";
1171 1171
 			}
1172 1172
 		}
1173 1173
 
@@ -1177,16 +1177,16 @@  discard block
 block discarded – undo
1177 1177
 			$height += 45;
1178 1178
 			if ($native)
1179 1179
 			{
1180
-				$embed .= "<embed type=\"application/x-mplayer2\" src=\"" . $this->get_link() . "\" autosize=\"1\" width=\"$width\" height=\"$height\" showcontrols=\"1\" showstatusbar=\"0\" showdisplay=\"0\" autostart=\"0\"></embed>";
1180
+				$embed .= "<embed type=\"application/x-mplayer2\" src=\"".$this->get_link()."\" autosize=\"1\" width=\"$width\" height=\"$height\" showcontrols=\"1\" showstatusbar=\"0\" showdisplay=\"0\" autostart=\"0\"></embed>";
1181 1181
 			}
1182 1182
 			else
1183 1183
 			{
1184
-				$embed .= "<script type='text/javascript'>embed_wmedia('$width', '$height', '" . $this->get_link() . "');</script>";
1184
+				$embed .= "<script type='text/javascript'>embed_wmedia('$width', '$height', '".$this->get_link()."');</script>";
1185 1185
 			}
1186 1186
 		}
1187 1187
 
1188 1188
 		// Everything else
1189
-		else $embed .= '<a href="' . $this->get_link() . '" class="' . $altclass . '">' . $alt . '</a>';
1189
+		else $embed .= '<a href="'.$this->get_link().'" class="'.$altclass.'">'.$alt.'</a>';
1190 1190
 
1191 1191
 		return $embed;
1192 1192
 	}
@@ -1206,7 +1206,7 @@  discard block
 block discarded – undo
1206 1206
 	{
1207 1207
 		// Mime-types by handler.
1208 1208
 		$types_flash = array('application/x-shockwave-flash', 'application/futuresplash'); // Flash
1209
-		$types_fmedia = array('video/flv', 'video/x-flv','flv-application/octet-stream'); // Flash Media Player
1209
+		$types_fmedia = array('video/flv', 'video/x-flv', 'flv-application/octet-stream'); // Flash Media Player
1210 1210
 		$types_quicktime = array('audio/3gpp', 'audio/3gpp2', 'audio/aac', 'audio/x-aac', 'audio/aiff', 'audio/x-aiff', 'audio/mid', 'audio/midi', 'audio/x-midi', 'audio/mp4', 'audio/m4a', 'audio/x-m4a', 'audio/wav', 'audio/x-wav', 'video/3gpp', 'video/3gpp2', 'video/m4v', 'video/x-m4v', 'video/mp4', 'video/mpeg', 'video/x-mpeg', 'video/quicktime', 'video/sd-video'); // QuickTime
1211 1211
 		$types_wmedia = array('application/asx', 'application/x-mplayer2', 'audio/x-ms-wma', 'audio/x-ms-wax', 'video/x-ms-asf-plugin', 'video/x-ms-asf', 'video/x-ms-wm', 'video/x-ms-wmv', 'video/x-ms-wvx'); // Windows Media
1212 1212
 		$types_mp3 = array('audio/mp3', 'audio/x-mp3', 'audio/mpeg', 'audio/x-mpeg'); // MP3
@@ -1221,7 +1221,7 @@  discard block
 block discarded – undo
1221 1221
 		}
1222 1222
 
1223 1223
 		// If we encounter an unsupported mime-type, check the file extension and guess intelligently.
1224
-		if (!in_array($type, array_merge($types_flash, $types_fmedia, $types_quicktime, $types_wmedia, $types_mp3)))
1224
+		if ( ! in_array($type, array_merge($types_flash, $types_fmedia, $types_quicktime, $types_wmedia, $types_mp3)))
1225 1225
 		{
1226 1226
 			switch (strtolower($this->get_extension()))
1227 1227
 			{
Please login to merge, or discard this patch.
Braces   +61 added lines, -117 removed lines patch added patch discarded remove patch
@@ -282,8 +282,7 @@  discard block
 block discarded – undo
282 282
 		if ($this->bitrate !== null)
283 283
 		{
284 284
 			return $this->bitrate;
285
-		}
286
-		else
285
+		} else
287 286
 		{
288 287
 			return null;
289 288
 		}
@@ -301,8 +300,7 @@  discard block
 block discarded – undo
301 300
 		if (isset($captions[$key]))
302 301
 		{
303 302
 			return $captions[$key];
304
-		}
305
-		else
303
+		} else
306 304
 		{
307 305
 			return null;
308 306
 		}
@@ -318,8 +316,7 @@  discard block
 block discarded – undo
318 316
 		if ($this->captions !== null)
319 317
 		{
320 318
 			return $this->captions;
321
-		}
322
-		else
319
+		} else
323 320
 		{
324 321
 			return null;
325 322
 		}
@@ -337,8 +334,7 @@  discard block
 block discarded – undo
337 334
 		if (isset($categories[$key]))
338 335
 		{
339 336
 			return $categories[$key];
340
-		}
341
-		else
337
+		} else
342 338
 		{
343 339
 			return null;
344 340
 		}
@@ -354,8 +350,7 @@  discard block
 block discarded – undo
354 350
 		if ($this->categories !== null)
355 351
 		{
356 352
 			return $this->categories;
357
-		}
358
-		else
353
+		} else
359 354
 		{
360 355
 			return null;
361 356
 		}
@@ -371,8 +366,7 @@  discard block
 block discarded – undo
371 366
 		if ($this->channels !== null)
372 367
 		{
373 368
 			return $this->channels;
374
-		}
375
-		else
369
+		} else
376 370
 		{
377 371
 			return null;
378 372
 		}
@@ -388,8 +382,7 @@  discard block
 block discarded – undo
388 382
 		if ($this->copyright !== null)
389 383
 		{
390 384
 			return $this->copyright;
391
-		}
392
-		else
385
+		} else
393 386
 		{
394 387
 			return null;
395 388
 		}
@@ -407,8 +400,7 @@  discard block
 block discarded – undo
407 400
 		if (isset($credits[$key]))
408 401
 		{
409 402
 			return $credits[$key];
410
-		}
411
-		else
403
+		} else
412 404
 		{
413 405
 			return null;
414 406
 		}
@@ -424,8 +416,7 @@  discard block
 block discarded – undo
424 416
 		if ($this->credits !== null)
425 417
 		{
426 418
 			return $this->credits;
427
-		}
428
-		else
419
+		} else
429 420
 		{
430 421
 			return null;
431 422
 		}
@@ -441,8 +432,7 @@  discard block
 block discarded – undo
441 432
 		if ($this->description !== null)
442 433
 		{
443 434
 			return $this->description;
444
-		}
445
-		else
435
+		} else
446 436
 		{
447 437
 			return null;
448 438
 		}
@@ -462,13 +452,11 @@  discard block
 block discarded – undo
462 452
 			{
463 453
 				$time = SimplePie_Misc::time_hms($this->duration);
464 454
 				return $time;
465
-			}
466
-			else
455
+			} else
467 456
 			{
468 457
 				return $this->duration;
469 458
 			}
470
-		}
471
-		else
459
+		} else
472 460
 		{
473 461
 			return null;
474 462
 		}
@@ -484,8 +472,7 @@  discard block
 block discarded – undo
484 472
 		if ($this->expression !== null)
485 473
 		{
486 474
 			return $this->expression;
487
-		}
488
-		else
475
+		} else
489 476
 		{
490 477
 			return 'full';
491 478
 		}
@@ -519,8 +506,7 @@  discard block
 block discarded – undo
519 506
 		if ($this->framerate !== null)
520 507
 		{
521 508
 			return $this->framerate;
522
-		}
523
-		else
509
+		} else
524 510
 		{
525 511
 			return null;
526 512
 		}
@@ -549,8 +535,7 @@  discard block
 block discarded – undo
549 535
 		if (isset($hashes[$key]))
550 536
 		{
551 537
 			return $hashes[$key];
552
-		}
553
-		else
538
+		} else
554 539
 		{
555 540
 			return null;
556 541
 		}
@@ -566,8 +551,7 @@  discard block
 block discarded – undo
566 551
 		if ($this->hashes !== null)
567 552
 		{
568 553
 			return $this->hashes;
569
-		}
570
-		else
554
+		} else
571 555
 		{
572 556
 			return null;
573 557
 		}
@@ -583,8 +567,7 @@  discard block
 block discarded – undo
583 567
 		if ($this->height !== null)
584 568
 		{
585 569
 			return $this->height;
586
-		}
587
-		else
570
+		} else
588 571
 		{
589 572
 			return null;
590 573
 		}
@@ -601,8 +584,7 @@  discard block
 block discarded – undo
601 584
 		if ($this->lang !== null)
602 585
 		{
603 586
 			return $this->lang;
604
-		}
605
-		else
587
+		} else
606 588
 		{
607 589
 			return null;
608 590
 		}
@@ -620,8 +602,7 @@  discard block
 block discarded – undo
620 602
 		if (isset($keywords[$key]))
621 603
 		{
622 604
 			return $keywords[$key];
623
-		}
624
-		else
605
+		} else
625 606
 		{
626 607
 			return null;
627 608
 		}
@@ -637,8 +618,7 @@  discard block
 block discarded – undo
637 618
 		if ($this->keywords !== null)
638 619
 		{
639 620
 			return $this->keywords;
640
-		}
641
-		else
621
+		} else
642 622
 		{
643 623
 			return null;
644 624
 		}
@@ -654,8 +634,7 @@  discard block
 block discarded – undo
654 634
 		if ($this->length !== null)
655 635
 		{
656 636
 			return $this->length;
657
-		}
658
-		else
637
+		} else
659 638
 		{
660 639
 			return null;
661 640
 		}
@@ -671,8 +650,7 @@  discard block
 block discarded – undo
671 650
 		if ($this->link !== null)
672 651
 		{
673 652
 			return urldecode($this->link);
674
-		}
675
-		else
653
+		} else
676 654
 		{
677 655
 			return null;
678 656
 		}
@@ -689,8 +667,7 @@  discard block
 block discarded – undo
689 667
 		if ($this->medium !== null)
690 668
 		{
691 669
 			return $this->medium;
692
-		}
693
-		else
670
+		} else
694 671
 		{
695 672
 			return null;
696 673
 		}
@@ -707,8 +684,7 @@  discard block
 block discarded – undo
707 684
 		if ($this->player !== null)
708 685
 		{
709 686
 			return $this->player;
710
-		}
711
-		else
687
+		} else
712 688
 		{
713 689
 			return null;
714 690
 		}
@@ -726,8 +702,7 @@  discard block
 block discarded – undo
726 702
 		if (isset($ratings[$key]))
727 703
 		{
728 704
 			return $ratings[$key];
729
-		}
730
-		else
705
+		} else
731 706
 		{
732 707
 			return null;
733 708
 		}
@@ -743,8 +718,7 @@  discard block
 block discarded – undo
743 718
 		if ($this->ratings !== null)
744 719
 		{
745 720
 			return $this->ratings;
746
-		}
747
-		else
721
+		} else
748 722
 		{
749 723
 			return null;
750 724
 		}
@@ -762,8 +736,7 @@  discard block
 block discarded – undo
762 736
 		if (isset($restrictions[$key]))
763 737
 		{
764 738
 			return $restrictions[$key];
765
-		}
766
-		else
739
+		} else
767 740
 		{
768 741
 			return null;
769 742
 		}
@@ -779,8 +752,7 @@  discard block
 block discarded – undo
779 752
 		if ($this->restrictions !== null)
780 753
 		{
781 754
 			return $this->restrictions;
782
-		}
783
-		else
755
+		} else
784 756
 		{
785 757
 			return null;
786 758
 		}
@@ -796,8 +768,7 @@  discard block
 block discarded – undo
796 768
 		if ($this->samplingrate !== null)
797 769
 		{
798 770
 			return $this->samplingrate;
799
-		}
800
-		else
771
+		} else
801 772
 		{
802 773
 			return null;
803 774
 		}
@@ -814,8 +785,7 @@  discard block
 block discarded – undo
814 785
 		if ($length !== null)
815 786
 		{
816 787
 			return round($length/1048576, 2);
817
-		}
818
-		else
788
+		} else
819 789
 		{
820 790
 			return null;
821 791
 		}
@@ -833,8 +803,7 @@  discard block
 block discarded – undo
833 803
 		if (isset($thumbnails[$key]))
834 804
 		{
835 805
 			return $thumbnails[$key];
836
-		}
837
-		else
806
+		} else
838 807
 		{
839 808
 			return null;
840 809
 		}
@@ -850,8 +819,7 @@  discard block
 block discarded – undo
850 819
 		if ($this->thumbnails !== null)
851 820
 		{
852 821
 			return $this->thumbnails;
853
-		}
854
-		else
822
+		} else
855 823
 		{
856 824
 			return null;
857 825
 		}
@@ -867,8 +835,7 @@  discard block
 block discarded – undo
867 835
 		if ($this->title !== null)
868 836
 		{
869 837
 			return $this->title;
870
-		}
871
-		else
838
+		} else
872 839
 		{
873 840
 			return null;
874 841
 		}
@@ -885,8 +852,7 @@  discard block
 block discarded – undo
885 852
 		if ($this->type !== null)
886 853
 		{
887 854
 			return $this->type;
888
-		}
889
-		else
855
+		} else
890 856
 		{
891 857
 			return null;
892 858
 		}
@@ -902,8 +868,7 @@  discard block
 block discarded – undo
902 868
 		if ($this->width !== null)
903 869
 		{
904 870
 			return $this->width;
905
-		}
906
-		else
871
+		} else
907 872
 		{
908 873
 			return null;
909 874
 		}
@@ -987,8 +952,7 @@  discard block
 block discarded – undo
987 952
 		if (is_array($options))
988 953
 		{
989 954
 			extract($options);
990
-		}
991
-		else
955
+		} else
992 956
 		{
993 957
 			$options = explode(',', $options);
994 958
 			foreach($options as $option)
@@ -1055,17 +1019,14 @@  discard block
 block discarded – undo
1055 1019
 				if ($height === 'auto')
1056 1020
 				{
1057 1021
 					$width = 480;
1058
-				}
1059
-				elseif ($widescreen)
1022
+				} elseif ($widescreen)
1060 1023
 				{
1061 1024
 					$width = round((intval($height)/9)*16);
1062
-				}
1063
-				else
1025
+				} else
1064 1026
 				{
1065 1027
 					$width = round((intval($height)/3)*4);
1066 1028
 				}
1067
-			}
1068
-			else
1029
+			} else
1069 1030
 			{
1070 1031
 				$width = '100%';
1071 1032
 			}
@@ -1076,35 +1037,29 @@  discard block
 block discarded – undo
1076 1037
 			if ($mime === 'audio')
1077 1038
 			{
1078 1039
 				$height = 0;
1079
-			}
1080
-			elseif ($mime === 'video')
1040
+			} elseif ($mime === 'video')
1081 1041
 			{
1082 1042
 				if ($width === 'auto')
1083 1043
 				{
1084 1044
 					if ($widescreen)
1085 1045
 					{
1086 1046
 						$height = 270;
1087
-					}
1088
-					else
1047
+					} else
1089 1048
 					{
1090 1049
 						$height = 360;
1091 1050
 					}
1092
-				}
1093
-				elseif ($widescreen)
1051
+				} elseif ($widescreen)
1094 1052
 				{
1095 1053
 					$height = round((intval($width)/16)*9);
1096
-				}
1097
-				else
1054
+				} else
1098 1055
 				{
1099 1056
 					$height = round((intval($width)/4)*3);
1100 1057
 				}
1101
-			}
1102
-			else
1058
+			} else
1103 1059
 			{
1104 1060
 				$height = 376;
1105 1061
 			}
1106
-		}
1107
-		elseif ($mime === 'audio')
1062
+		} elseif ($mime === 'audio')
1108 1063
 		{
1109 1064
 			$height = 0;
1110 1065
 		}
@@ -1113,8 +1068,7 @@  discard block
 block discarded – undo
1113 1068
 		if ($mime === 'audio')
1114 1069
 		{
1115 1070
 			$placeholder = $audio;
1116
-		}
1117
-		elseif ($mime === 'video')
1071
+		} elseif ($mime === 'video')
1118 1072
 		{
1119 1073
 			$placeholder = $video;
1120 1074
 		}
@@ -1127,8 +1081,7 @@  discard block
 block discarded – undo
1127 1081
 			if ($native)
1128 1082
 			{
1129 1083
 				$embed .= "<embed src=\"" . $this->get_link() . "\" pluginspage=\"http://adobe.com/go/getflashplayer\" type=\"$type\" quality=\"high\" width=\"$width\" height=\"$height\" bgcolor=\"$bgcolor\" loop=\"$loop\"></embed>";
1130
-			}
1131
-			else
1084
+			} else
1132 1085
 			{
1133 1086
 				$embed .= "<script type='text/javascript'>embed_flash('$bgcolor', '$width', '$height', '" . $this->get_link() . "', '$loop', '$type');</script>";
1134 1087
 			}
@@ -1142,8 +1095,7 @@  discard block
 block discarded – undo
1142 1095
 			if ($native)
1143 1096
 			{
1144 1097
 				$embed .= "<embed src=\"$mediaplayer\" pluginspage=\"http://adobe.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" quality=\"high\" width=\"$width\" height=\"$height\" wmode=\"transparent\" flashvars=\"file=" . rawurlencode($this->get_link().'?file_extension=.'.$this->get_extension()) . "&autostart=false&repeat=$loop&showdigits=true&showfsbutton=false\"></embed>";
1145
-			}
1146
-			else
1098
+			} else
1147 1099
 			{
1148 1100
 				$embed .= "<script type='text/javascript'>embed_flv('$width', '$height', '" . rawurlencode($this->get_link().'?file_extension=.'.$this->get_extension()) . "', '$placeholder', '$loop', '$mediaplayer');</script>";
1149 1101
 			}
@@ -1159,13 +1111,11 @@  discard block
 block discarded – undo
1159 1111
 				if ($placeholder !== '')
1160 1112
 				{
1161 1113
 					$embed .= "<embed type=\"$type\" style=\"cursor:hand; cursor:pointer;\" href=\"" . $this->get_link() . "\" src=\"$placeholder\" width=\"$width\" height=\"$height\" autoplay=\"false\" target=\"myself\" controller=\"false\" loop=\"$loop\" scale=\"aspect\" bgcolor=\"$bgcolor\" pluginspage=\"http://apple.com/quicktime/download/\"></embed>";
1162
-				}
1163
-				else
1114
+				} else
1164 1115
 				{
1165 1116
 					$embed .= "<embed type=\"$type\" style=\"cursor:hand; cursor:pointer;\" src=\"" . $this->get_link() . "\" width=\"$width\" height=\"$height\" autoplay=\"false\" target=\"myself\" controller=\"true\" loop=\"$loop\" scale=\"aspect\" bgcolor=\"$bgcolor\" pluginspage=\"http://apple.com/quicktime/download/\"></embed>";
1166 1117
 				}
1167
-			}
1168
-			else
1118
+			} else
1169 1119
 			{
1170 1120
 				$embed .= "<script type='text/javascript'>embed_quicktime('$type', '$bgcolor', '$width', '$height', '" . $this->get_link() . "', '$placeholder', '$loop');</script>";
1171 1121
 			}
@@ -1178,15 +1128,16 @@  discard block
 block discarded – undo
1178 1128
 			if ($native)
1179 1129
 			{
1180 1130
 				$embed .= "<embed type=\"application/x-mplayer2\" src=\"" . $this->get_link() . "\" autosize=\"1\" width=\"$width\" height=\"$height\" showcontrols=\"1\" showstatusbar=\"0\" showdisplay=\"0\" autostart=\"0\"></embed>";
1181
-			}
1182
-			else
1131
+			} else
1183 1132
 			{
1184 1133
 				$embed .= "<script type='text/javascript'>embed_wmedia('$width', '$height', '" . $this->get_link() . "');</script>";
1185 1134
 			}
1186 1135
 		}
1187 1136
 
1188 1137
 		// Everything else
1189
-		else $embed .= '<a href="' . $this->get_link() . '" class="' . $altclass . '">' . $alt . '</a>';
1138
+		else {
1139
+			$embed .= '<a href="' . $this->get_link() . '" class="' . $altclass . '">' . $alt . '</a>';
1140
+		}
1190 1141
 
1191 1142
 		return $embed;
1192 1143
 	}
@@ -1214,8 +1165,7 @@  discard block
 block discarded – undo
1214 1165
 		if ($this->get_type() !== null)
1215 1166
 		{
1216 1167
 			$type = strtolower($this->type);
1217
-		}
1218
-		else
1168
+		} else
1219 1169
 		{
1220 1170
 			$type = null;
1221 1171
 		}
@@ -1349,29 +1299,23 @@  discard block
 block discarded – undo
1349 1299
 			if (in_array($type, $types_flash))
1350 1300
 			{
1351 1301
 				return 'flash';
1352
-			}
1353
-			elseif (in_array($type, $types_fmedia))
1302
+			} elseif (in_array($type, $types_fmedia))
1354 1303
 			{
1355 1304
 				return 'fmedia';
1356
-			}
1357
-			elseif (in_array($type, $types_quicktime))
1305
+			} elseif (in_array($type, $types_quicktime))
1358 1306
 			{
1359 1307
 				return 'quicktime';
1360
-			}
1361
-			elseif (in_array($type, $types_wmedia))
1308
+			} elseif (in_array($type, $types_wmedia))
1362 1309
 			{
1363 1310
 				return 'wmedia';
1364
-			}
1365
-			elseif (in_array($type, $types_mp3))
1311
+			} elseif (in_array($type, $types_mp3))
1366 1312
 			{
1367 1313
 				return 'mp3';
1368
-			}
1369
-			else
1314
+			} else
1370 1315
 			{
1371 1316
 				return null;
1372 1317
 			}
1373
-		}
1374
-		else
1318
+		} else
1375 1319
 		{
1376 1320
 			return $type;
1377 1321
 		}
Please login to merge, or discard this patch.
src/wp-includes/SimplePie/IRI.php 3 patches
Doc Comments   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
 	 *
265 265
 	 * Returns false if $base is not absolute, otherwise an IRI.
266 266
 	 *
267
-	 * @param IRI|string $base (Absolute) Base IRI
267
+	 * @param SimplePie_IRI $base (Absolute) Base IRI
268 268
 	 * @param IRI|string $relative Relative IRI
269 269
 	 * @return IRI|false
270 270
 	 */
@@ -1119,6 +1119,7 @@  discard block
 block discarded – undo
1119 1119
 	/**
1120 1120
 	 * Convert an IRI to a URI (or parts thereof)
1121 1121
 	 *
1122
+	 * @param false|string $string
1122 1123
 	 * @return string
1123 1124
 	 */
1124 1125
 	public function to_uri($string)
Please login to merge, or discard this patch.
Spacing   +42 added lines, -42 removed lines patch added patch discarded remove patch
@@ -148,9 +148,9 @@  discard block
 block discarded – undo
148 148
 	 */
149 149
 	public function __set($name, $value)
150 150
 	{
151
-		if (method_exists($this, 'set_' . $name))
151
+		if (method_exists($this, 'set_'.$name))
152 152
 		{
153
-			call_user_func(array($this, 'set_' . $name), $value);
153
+			call_user_func(array($this, 'set_'.$name), $value);
154 154
 		}
155 155
 		elseif (
156 156
 			   $name === 'iauthority'
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
 			|| $name === 'ifragment'
162 162
 		)
163 163
 		{
164
-			call_user_func(array($this, 'set_' . substr($name, 1)), $value);
164
+			call_user_func(array($this, 'set_'.substr($name, 1)), $value);
165 165
 		}
166 166
 	}
167 167
 
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
 			$return = $this->$name;
192 192
 		}
193 193
 		// host -> ihost
194
-		elseif (($prop = 'i' . $name) && array_key_exists($prop, $props))
194
+		elseif (($prop = 'i'.$name) && array_key_exists($prop, $props))
195 195
 		{
196 196
 			$name = $prop;
197 197
 			$return = $this->$prop;
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
 		}
205 205
 		else
206 206
 		{
207
-			trigger_error('Undefined property: ' . get_class($this) . '::' . $name, E_USER_NOTICE);
207
+			trigger_error('Undefined property: '.get_class($this).'::'.$name, E_USER_NOTICE);
208 208
 			$return = null;
209 209
 		}
210 210
 
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
 	 */
227 227
 	public function __isset($name)
228 228
 	{
229
-		if (method_exists($this, 'get_' . $name) || isset($this->$name))
229
+		if (method_exists($this, 'get_'.$name) || isset($this->$name))
230 230
 		{
231 231
 			return true;
232 232
 		}
@@ -243,9 +243,9 @@  discard block
 block discarded – undo
243 243
 	 */
244 244
 	public function __unset($name)
245 245
 	{
246
-		if (method_exists($this, 'set_' . $name))
246
+		if (method_exists($this, 'set_'.$name))
247 247
 		{
248
-			call_user_func(array($this, 'set_' . $name), '');
248
+			call_user_func(array($this, 'set_'.$name), '');
249 249
 		}
250 250
 	}
251 251
 
@@ -270,11 +270,11 @@  discard block
 block discarded – undo
270 270
 	 */
271 271
 	public static function absolutize($base, $relative)
272 272
 	{
273
-		if (!($relative instanceof SimplePie_IRI))
273
+		if ( ! ($relative instanceof SimplePie_IRI))
274 274
 		{
275 275
 			$relative = new SimplePie_IRI($relative);
276 276
 		}
277
-		if (!$relative->is_valid())
277
+		if ( ! $relative->is_valid())
278 278
 		{
279 279
 			return false;
280 280
 		}
@@ -284,7 +284,7 @@  discard block
 block discarded – undo
284 284
 		}
285 285
 		else
286 286
 		{
287
-			if (!($base instanceof SimplePie_IRI))
287
+			if ( ! ($base instanceof SimplePie_IRI))
288 288
 			{
289 289
 				$base = new SimplePie_IRI($base);
290 290
 			}
@@ -312,11 +312,11 @@  discard block
 block discarded – undo
312 312
 							}
313 313
 							elseif (($base->iuserinfo !== null || $base->ihost !== null || $base->port !== null) && $base->ipath === '')
314 314
 							{
315
-								$target->ipath = '/' . $relative->ipath;
315
+								$target->ipath = '/'.$relative->ipath;
316 316
 							}
317 317
 							elseif (($last_segment = strrpos($base->ipath, '/')) !== false)
318 318
 							{
319
-								$target->ipath = substr($base->ipath, 0, $last_segment + 1) . $relative->ipath;
319
+								$target->ipath = substr($base->ipath, 0, $last_segment + 1).$relative->ipath;
320 320
 							}
321 321
 							else
322 322
 							{
@@ -370,19 +370,19 @@  discard block
 block discarded – undo
370 370
 			{
371 371
 				$match['scheme'] = null;
372 372
 			}
373
-			if (!isset($match[3]) || $match[3] === '')
373
+			if ( ! isset($match[3]) || $match[3] === '')
374 374
 			{
375 375
 				$match['authority'] = null;
376 376
 			}
377
-			if (!isset($match[5]))
377
+			if ( ! isset($match[5]))
378 378
 			{
379 379
 				$match['path'] = '';
380 380
 			}
381
-			if (!isset($match[6]) || $match[6] === '')
381
+			if ( ! isset($match[6]) || $match[6] === '')
382 382
 			{
383 383
 				$match['query'] = null;
384 384
 			}
385
-			if (!isset($match[8]) || $match[8] === '')
385
+			if ( ! isset($match[8]) || $match[8] === '')
386 386
 			{
387 387
 				$match['fragment'] = null;
388 388
 			}
@@ -452,7 +452,7 @@  discard block
 block discarded – undo
452 452
 				$input = '';
453 453
 			}
454 454
 		}
455
-		return $output . $input;
455
+		return $output.$input;
456 456
 	}
457 457
 
458 458
 	/**
@@ -551,7 +551,7 @@  discard block
 block discarded – undo
551 551
 			// Percent encode anything invalid or not in ucschar
552 552
 			if (
553 553
 				// Invalid sequences
554
-				!$valid
554
+				! $valid
555 555
 				// Non-shortest form sequences are invalid
556 556
 				|| $length > 1 && $character <= 0x7F
557 557
 				|| $length > 2 && $character <= 0x7FF
@@ -568,7 +568,7 @@  discard block
 block discarded – undo
568 568
 				)
569 569
 				&& (
570 570
 					// Everything not in iprivate, if it applies
571
-					   !$iprivate
571
+					   ! $iprivate
572 572
 					|| $character < 0xE000
573 573
 					|| $character > 0x10FFFD
574 574
 				)
@@ -618,7 +618,7 @@  discard block
 block discarded – undo
618 618
 			$value = hexdec($bytes[$i]);
619 619
 
620 620
 			// If we're the first byte of sequence:
621
-			if (!$remaining)
621
+			if ( ! $remaining)
622 622
 			{
623 623
 				// Start position
624 624
 				$start = $i;
@@ -679,12 +679,12 @@  discard block
 block discarded – undo
679 679
 			}
680 680
 
681 681
 			// If we've reached the end of the current byte sequence, append it to Unicode::$data
682
-			if (!$remaining)
682
+			if ( ! $remaining)
683 683
 			{
684 684
 				// Percent encode anything invalid or not in iunreserved
685 685
 				if (
686 686
 					// Invalid sequences
687
-					!$valid
687
+					! $valid
688 688
 					// Non-shortest form sequences are invalid
689 689
 					|| $length > 1 && $character <= 0x7F
690 690
 					|| $length > 2 && $character <= 0x7FF
@@ -706,7 +706,7 @@  discard block
 block discarded – undo
706 706
 				{
707 707
 					for ($j = $start; $j <= $i; $j++)
708 708
 					{
709
-						$string .= '%' . strtoupper($bytes[$j]);
709
+						$string .= '%'.strtoupper($bytes[$j]);
710 710
 					}
711 711
 				}
712 712
 				else
@@ -725,7 +725,7 @@  discard block
 block discarded – undo
725 725
 		{
726 726
 			for ($j = $start; $j < $len; $j++)
727 727
 			{
728
-				$string .= '%' . strtoupper($bytes[$j]);
728
+				$string .= '%'.strtoupper($bytes[$j]);
729 729
 			}
730 730
 		}
731 731
 
@@ -777,7 +777,7 @@  discard block
 block discarded – undo
777 777
 				) ||
778 778
 				(
779 779
 					$this->scheme === null &&
780
-					!$isauthority &&
780
+					! $isauthority &&
781 781
 					strpos($this->ipath, ':') !== false &&
782 782
 					(strpos($this->ipath, '/') === false ? true : strpos($this->ipath, ':') < strpos($this->ipath, '/'))
783 783
 				)
@@ -800,7 +800,7 @@  discard block
 block discarded – undo
800 800
 	public function set_iri($iri)
801 801
 	{
802 802
 		static $cache;
803
-		if (!$cache)
803
+		if ( ! $cache)
804 804
 		{
805 805
 			$cache = array();
806 806
 		}
@@ -824,7 +824,7 @@  discard block
 block discarded – undo
824 824
 		else
825 825
 		{
826 826
 			$parsed = $this->parse_iri((string) $iri);
827
-			if (!$parsed)
827
+			if ( ! $parsed)
828 828
 			{
829 829
 				return false;
830 830
 			}
@@ -860,7 +860,7 @@  discard block
 block discarded – undo
860 860
 		{
861 861
 			$this->scheme = null;
862 862
 		}
863
-		elseif (!preg_match('/^[A-Za-z][0-9A-Za-z+\-.]*$/', $scheme))
863
+		elseif ( ! preg_match('/^[A-Za-z][0-9A-Za-z+\-.]*$/', $scheme))
864 864
 		{
865 865
 			$this->scheme = null;
866 866
 			return false;
@@ -882,7 +882,7 @@  discard block
 block discarded – undo
882 882
 	public function set_authority($authority)
883 883
 	{
884 884
 		static $cache;
885
-		if (!$cache)
885
+		if ( ! $cache)
886 886
 			$cache = array();
887 887
 
888 888
 		if ($authority === null)
@@ -978,7 +978,7 @@  discard block
 block discarded – undo
978 978
 		{
979 979
 			if (SimplePie_Net_IPv6::check_ipv6(substr($ihost, 1, -1)))
980 980
 			{
981
-				$this->ihost = '[' . SimplePie_Net_IPv6::compress(substr($ihost, 1, -1)) . ']';
981
+				$this->ihost = '['.SimplePie_Net_IPv6::compress(substr($ihost, 1, -1)).']';
982 982
 			}
983 983
 			else
984 984
 			{
@@ -1052,7 +1052,7 @@  discard block
 block discarded – undo
1052 1052
 	public function set_path($ipath)
1053 1053
 	{
1054 1054
 		static $cache;
1055
-		if (!$cache)
1055
+		if ( ! $cache)
1056 1056
 		{
1057 1057
 			$cache = array();
1058 1058
 		}
@@ -1069,7 +1069,7 @@  discard block
 block discarded – undo
1069 1069
 			$removed = $this->remove_dot_segments($valid);
1070 1070
 
1071 1071
 			$cache[$ipath] = array($valid, $removed);
1072
-			$this->ipath =  ($this->scheme !== null) ? $removed : $valid;
1072
+			$this->ipath = ($this->scheme !== null) ? $removed : $valid;
1073 1073
 		}
1074 1074
 
1075 1075
 		$this->scheme_normalization();
@@ -1124,7 +1124,7 @@  discard block
 block discarded – undo
1124 1124
 	public function to_uri($string)
1125 1125
 	{
1126 1126
 		static $non_ascii;
1127
-		if (!$non_ascii)
1127
+		if ( ! $non_ascii)
1128 1128
 		{
1129 1129
 			$non_ascii = implode('', range("\x80", "\xFF"));
1130 1130
 		}
@@ -1148,7 +1148,7 @@  discard block
 block discarded – undo
1148 1148
 	 */
1149 1149
 	public function get_iri()
1150 1150
 	{
1151
-		if (!$this->is_valid())
1151
+		if ( ! $this->is_valid())
1152 1152
 		{
1153 1153
 			return false;
1154 1154
 		}
@@ -1156,27 +1156,27 @@  discard block
 block discarded – undo
1156 1156
 		$iri = '';
1157 1157
 		if ($this->scheme !== null)
1158 1158
 		{
1159
-			$iri .= $this->scheme . ':';
1159
+			$iri .= $this->scheme.':';
1160 1160
 		}
1161 1161
 		if (($iauthority = $this->get_iauthority()) !== null)
1162 1162
 		{
1163
-			$iri .= '//' . $iauthority;
1163
+			$iri .= '//'.$iauthority;
1164 1164
 		}
1165 1165
 		if ($this->ipath !== '')
1166 1166
 		{
1167 1167
 			$iri .= $this->ipath;
1168 1168
 		}
1169
-		elseif (!empty($this->normalization[$this->scheme]['ipath']) && $iauthority !== null && $iauthority !== '')
1169
+		elseif ( ! empty($this->normalization[$this->scheme]['ipath']) && $iauthority !== null && $iauthority !== '')
1170 1170
 		{
1171 1171
 			$iri .= $this->normalization[$this->scheme]['ipath'];
1172 1172
 		}
1173 1173
 		if ($this->iquery !== null)
1174 1174
 		{
1175
-			$iri .= '?' . $this->iquery;
1175
+			$iri .= '?'.$this->iquery;
1176 1176
 		}
1177 1177
 		if ($this->ifragment !== null)
1178 1178
 		{
1179
-			$iri .= '#' . $this->ifragment;
1179
+			$iri .= '#'.$this->ifragment;
1180 1180
 		}
1181 1181
 
1182 1182
 		return $iri;
@@ -1204,7 +1204,7 @@  discard block
 block discarded – undo
1204 1204
 			$iauthority = '';
1205 1205
 			if ($this->iuserinfo !== null)
1206 1206
 			{
1207
-				$iauthority .= $this->iuserinfo . '@';
1207
+				$iauthority .= $this->iuserinfo.'@';
1208 1208
 			}
1209 1209
 			if ($this->ihost !== null)
1210 1210
 			{
@@ -1212,7 +1212,7 @@  discard block
 block discarded – undo
1212 1212
 			}
1213 1213
 			if ($this->port !== null)
1214 1214
 			{
1215
-				$iauthority .= ':' . $this->port;
1215
+				$iauthority .= ':'.$this->port;
1216 1216
 			}
1217 1217
 			return $iauthority;
1218 1218
 		}
Please login to merge, or discard this patch.
Braces   +53 added lines, -92 removed lines patch added patch discarded remove patch
@@ -151,8 +151,7 @@  discard block
 block discarded – undo
151 151
 		if (method_exists($this, 'set_' . $name))
152 152
 		{
153 153
 			call_user_func(array($this, 'set_' . $name), $value);
154
-		}
155
-		elseif (
154
+		} elseif (
156 155
 			   $name === 'iauthority'
157 156
 			|| $name === 'iuserinfo'
158 157
 			|| $name === 'ihost'
@@ -185,8 +184,7 @@  discard block
 block discarded – undo
185 184
 		)
186 185
 		{
187 186
 			$return = $this->{"get_$name"}();
188
-		}
189
-		elseif (array_key_exists($name, $props))
187
+		} elseif (array_key_exists($name, $props))
190 188
 		{
191 189
 			$return = $this->$name;
192 190
 		}
@@ -201,8 +199,7 @@  discard block
 block discarded – undo
201 199
 		{
202 200
 			$name = $prop;
203 201
 			$return = $this->$prop;
204
-		}
205
-		else
202
+		} else
206 203
 		{
207 204
 			trigger_error('Undefined property: ' . get_class($this) . '::' . $name, E_USER_NOTICE);
208 205
 			$return = null;
@@ -211,8 +208,7 @@  discard block
 block discarded – undo
211 208
 		if ($return === null && isset($this->normalization[$this->scheme][$name]))
212 209
 		{
213 210
 			return $this->normalization[$this->scheme][$name];
214
-		}
215
-		else
211
+		} else
216 212
 		{
217 213
 			return $return;
218 214
 		}
@@ -229,8 +225,7 @@  discard block
 block discarded – undo
229 225
 		if (method_exists($this, 'get_' . $name) || isset($this->$name))
230 226
 		{
231 227
 			return true;
232
-		}
233
-		else
228
+		} else
234 229
 		{
235 230
 			return false;
236 231
 		}
@@ -277,12 +272,10 @@  discard block
 block discarded – undo
277 272
 		if (!$relative->is_valid())
278 273
 		{
279 274
 			return false;
280
-		}
281
-		elseif ($relative->scheme !== null)
275
+		} elseif ($relative->scheme !== null)
282 276
 		{
283 277
 			return clone $relative;
284
-		}
285
-		else
278
+		} else
286 279
 		{
287 280
 			if (!($base instanceof SimplePie_IRI))
288 281
 			{
@@ -296,8 +289,7 @@  discard block
 block discarded – undo
296 289
 					{
297 290
 						$target = clone $relative;
298 291
 						$target->scheme = $base->scheme;
299
-					}
300
-					else
292
+					} else
301 293
 					{
302 294
 						$target = new SimplePie_IRI;
303 295
 						$target->scheme = $base->scheme;
@@ -309,46 +301,39 @@  discard block
 block discarded – undo
309 301
 							if ($relative->ipath[0] === '/')
310 302
 							{
311 303
 								$target->ipath = $relative->ipath;
312
-							}
313
-							elseif (($base->iuserinfo !== null || $base->ihost !== null || $base->port !== null) && $base->ipath === '')
304
+							} elseif (($base->iuserinfo !== null || $base->ihost !== null || $base->port !== null) && $base->ipath === '')
314 305
 							{
315 306
 								$target->ipath = '/' . $relative->ipath;
316
-							}
317
-							elseif (($last_segment = strrpos($base->ipath, '/')) !== false)
307
+							} elseif (($last_segment = strrpos($base->ipath, '/')) !== false)
318 308
 							{
319 309
 								$target->ipath = substr($base->ipath, 0, $last_segment + 1) . $relative->ipath;
320
-							}
321
-							else
310
+							} else
322 311
 							{
323 312
 								$target->ipath = $relative->ipath;
324 313
 							}
325 314
 							$target->ipath = $target->remove_dot_segments($target->ipath);
326 315
 							$target->iquery = $relative->iquery;
327
-						}
328
-						else
316
+						} else
329 317
 						{
330 318
 							$target->ipath = $base->ipath;
331 319
 							if ($relative->iquery !== null)
332 320
 							{
333 321
 								$target->iquery = $relative->iquery;
334
-							}
335
-							elseif ($base->iquery !== null)
322
+							} elseif ($base->iquery !== null)
336 323
 							{
337 324
 								$target->iquery = $base->iquery;
338 325
 							}
339 326
 						}
340 327
 						$target->ifragment = $relative->ifragment;
341 328
 					}
342
-				}
343
-				else
329
+				} else
344 330
 				{
345 331
 					$target = clone $base;
346 332
 					$target->ifragment = null;
347 333
 				}
348 334
 				$target->scheme_normalization();
349 335
 				return $target;
350
-			}
351
-			else
336
+			} else
352 337
 			{
353 338
 				return false;
354 339
 			}
@@ -387,8 +372,7 @@  discard block
 block discarded – undo
387 372
 				$match['fragment'] = null;
388 373
 			}
389 374
 			return $match;
390
-		}
391
-		else
375
+		} else
392 376
 		{
393 377
 			// This can occur when a paragraph is accidentally parsed as a URI
394 378
 			return false;
@@ -410,8 +394,7 @@  discard block
 block discarded – undo
410 394
 			if (strpos($input, '../') === 0)
411 395
 			{
412 396
 				$input = substr($input, 3);
413
-			}
414
-			elseif (strpos($input, './') === 0)
397
+			} elseif (strpos($input, './') === 0)
415 398
 			{
416 399
 				$input = substr($input, 2);
417 400
 			}
@@ -419,8 +402,7 @@  discard block
 block discarded – undo
419 402
 			elseif (strpos($input, '/./') === 0)
420 403
 			{
421 404
 				$input = substr($input, 2);
422
-			}
423
-			elseif ($input === '/.')
405
+			} elseif ($input === '/.')
424 406
 			{
425 407
 				$input = '/';
426 408
 			}
@@ -429,8 +411,7 @@  discard block
 block discarded – undo
429 411
 			{
430 412
 				$input = substr($input, 3);
431 413
 				$output = substr_replace($output, '', strrpos($output, '/'));
432
-			}
433
-			elseif ($input === '/..')
414
+			} elseif ($input === '/..')
434 415
 			{
435 416
 				$input = '/';
436 417
 				$output = substr_replace($output, '', strrpos($output, '/'));
@@ -445,8 +426,7 @@  discard block
 block discarded – undo
445 426
 			{
446 427
 				$output .= substr($input, 0, $pos);
447 428
 				$input = substr_replace($input, '', 0, $pos);
448
-			}
449
-			else
429
+			} else
450 430
 			{
451 431
 				$output .= $input;
452 432
 				$input = '';
@@ -540,8 +520,7 @@  discard block
 block discarded – undo
540 520
 							break;
541 521
 						}
542 522
 					}
543
-				}
544
-				else
523
+				} else
545 524
 				{
546 525
 					$position = $strlen - 1;
547 526
 					$valid = false;
@@ -575,8 +554,9 @@  discard block
 block discarded – undo
575 554
 			)
576 555
 			{
577 556
 				// If we were a character, pretend we weren't, but rather an error.
578
-				if ($valid)
579
-					$position--;
557
+				if ($valid) {
558
+									$position--;
559
+				}
580 560
 
581 561
 				for ($j = $start; $j <= $position; $j++)
582 562
 				{
@@ -708,8 +688,7 @@  discard block
 block discarded – undo
708 688
 					{
709 689
 						$string .= '%' . strtoupper($bytes[$j]);
710 690
 					}
711
-				}
712
-				else
691
+				} else
713 692
 				{
714 693
 					for ($j = $start; $j <= $i; $j++)
715 694
 					{
@@ -808,8 +787,7 @@  discard block
 block discarded – undo
808 787
 		if ($iri === null)
809 788
 		{
810 789
 			return true;
811
-		}
812
-		elseif (isset($cache[$iri]))
790
+		} elseif (isset($cache[$iri]))
813 791
 		{
814 792
 			list($this->scheme,
815 793
 				 $this->iuserinfo,
@@ -820,8 +798,7 @@  discard block
 block discarded – undo
820 798
 				 $this->ifragment,
821 799
 				 $return) = $cache[$iri];
822 800
 			return $return;
823
-		}
824
-		else
801
+		} else
825 802
 		{
826 803
 			$parsed = $this->parse_iri((string) $iri);
827 804
 			if (!$parsed)
@@ -859,13 +836,11 @@  discard block
 block discarded – undo
859 836
 		if ($scheme === null)
860 837
 		{
861 838
 			$this->scheme = null;
862
-		}
863
-		elseif (!preg_match('/^[A-Za-z][0-9A-Za-z+\-.]*$/', $scheme))
839
+		} elseif (!preg_match('/^[A-Za-z][0-9A-Za-z+\-.]*$/', $scheme))
864 840
 		{
865 841
 			$this->scheme = null;
866 842
 			return false;
867
-		}
868
-		else
843
+		} else
869 844
 		{
870 845
 			$this->scheme = strtolower($scheme);
871 846
 		}
@@ -882,8 +857,9 @@  discard block
 block discarded – undo
882 857
 	public function set_authority($authority)
883 858
 	{
884 859
 		static $cache;
885
-		if (!$cache)
886
-			$cache = array();
860
+		if (!$cache) {
861
+					$cache = array();
862
+		}
887 863
 
888 864
 		if ($authority === null)
889 865
 		{
@@ -891,8 +867,7 @@  discard block
 block discarded – undo
891 867
 			$this->ihost = null;
892 868
 			$this->port = null;
893 869
 			return true;
894
-		}
895
-		elseif (isset($cache[$authority]))
870
+		} elseif (isset($cache[$authority]))
896 871
 		{
897 872
 			list($this->iuserinfo,
898 873
 				 $this->ihost,
@@ -900,16 +875,14 @@  discard block
 block discarded – undo
900 875
 				 $return) = $cache[$authority];
901 876
 
902 877
 			return $return;
903
-		}
904
-		else
878
+		} else
905 879
 		{
906 880
 			$remaining = $authority;
907 881
 			if (($iuserinfo_end = strrpos($remaining, '@')) !== false)
908 882
 			{
909 883
 				$iuserinfo = substr($remaining, 0, $iuserinfo_end);
910 884
 				$remaining = substr($remaining, $iuserinfo_end + 1);
911
-			}
912
-			else
885
+			} else
913 886
 			{
914 887
 				$iuserinfo = null;
915 888
 			}
@@ -920,8 +893,7 @@  discard block
 block discarded – undo
920 893
 					$port = null;
921 894
 				}
922 895
 				$remaining = substr($remaining, 0, $port_start);
923
-			}
924
-			else
896
+			} else
925 897
 			{
926 898
 				$port = null;
927 899
 			}
@@ -950,8 +922,7 @@  discard block
 block discarded – undo
950 922
 		if ($iuserinfo === null)
951 923
 		{
952 924
 			$this->iuserinfo = null;
953
-		}
954
-		else
925
+		} else
955 926
 		{
956 927
 			$this->iuserinfo = $this->replace_invalid_with_pct_encoding($iuserinfo, '!$&\'()*+,;=:');
957 928
 			$this->scheme_normalization();
@@ -973,20 +944,17 @@  discard block
 block discarded – undo
973 944
 		{
974 945
 			$this->ihost = null;
975 946
 			return true;
976
-		}
977
-		elseif (substr($ihost, 0, 1) === '[' && substr($ihost, -1) === ']')
947
+		} elseif (substr($ihost, 0, 1) === '[' && substr($ihost, -1) === ']')
978 948
 		{
979 949
 			if (SimplePie_Net_IPv6::check_ipv6(substr($ihost, 1, -1)))
980 950
 			{
981 951
 				$this->ihost = '[' . SimplePie_Net_IPv6::compress(substr($ihost, 1, -1)) . ']';
982
-			}
983
-			else
952
+			} else
984 953
 			{
985 954
 				$this->ihost = null;
986 955
 				return false;
987 956
 			}
988
-		}
989
-		else
957
+		} else
990 958
 		{
991 959
 			$ihost = $this->replace_invalid_with_pct_encoding($ihost, '!$&\'()*+,;=');
992 960
 
@@ -1000,8 +968,7 @@  discard block
 block discarded – undo
1000 968
 				if ($ihost[$position] === '%')
1001 969
 				{
1002 970
 					$position += 3;
1003
-				}
1004
-				else
971
+				} else
1005 972
 				{
1006 973
 					$ihost[$position] = strtolower($ihost[$position]);
1007 974
 					$position++;
@@ -1029,14 +996,12 @@  discard block
 block discarded – undo
1029 996
 		{
1030 997
 			$this->port = null;
1031 998
 			return true;
1032
-		}
1033
-		elseif (strspn($port, '0123456789') === strlen($port))
999
+		} elseif (strspn($port, '0123456789') === strlen($port))
1034 1000
 		{
1035 1001
 			$this->port = (int) $port;
1036 1002
 			$this->scheme_normalization();
1037 1003
 			return true;
1038
-		}
1039
-		else
1004
+		} else
1040 1005
 		{
1041 1006
 			$this->port = null;
1042 1007
 			return false;
@@ -1062,8 +1027,7 @@  discard block
 block discarded – undo
1062 1027
 		if (isset($cache[$ipath]))
1063 1028
 		{
1064 1029
 			$this->ipath = $cache[$ipath][(int) ($this->scheme !== null)];
1065
-		}
1066
-		else
1030
+		} else
1067 1031
 		{
1068 1032
 			$valid = $this->replace_invalid_with_pct_encoding($ipath, '!$&\'()*+,;=@:/');
1069 1033
 			$removed = $this->remove_dot_segments($valid);
@@ -1087,8 +1051,7 @@  discard block
 block discarded – undo
1087 1051
 		if ($iquery === null)
1088 1052
 		{
1089 1053
 			$this->iquery = null;
1090
-		}
1091
-		else
1054
+		} else
1092 1055
 		{
1093 1056
 			$this->iquery = $this->replace_invalid_with_pct_encoding($iquery, '!$&\'()*+,;=:@/?', true);
1094 1057
 			$this->scheme_normalization();
@@ -1107,8 +1070,7 @@  discard block
 block discarded – undo
1107 1070
 		if ($ifragment === null)
1108 1071
 		{
1109 1072
 			$this->ifragment = null;
1110
-		}
1111
-		else
1073
+		} else
1112 1074
 		{
1113 1075
 			$this->ifragment = $this->replace_invalid_with_pct_encoding($ifragment, '!$&\'()*+,;=:@/?');
1114 1076
 			$this->scheme_normalization();
@@ -1165,8 +1127,7 @@  discard block
 block discarded – undo
1165 1127
 		if ($this->ipath !== '')
1166 1128
 		{
1167 1129
 			$iri .= $this->ipath;
1168
-		}
1169
-		elseif (!empty($this->normalization[$this->scheme]['ipath']) && $iauthority !== null && $iauthority !== '')
1130
+		} elseif (!empty($this->normalization[$this->scheme]['ipath']) && $iauthority !== null && $iauthority !== '')
1170 1131
 		{
1171 1132
 			$iri .= $this->normalization[$this->scheme]['ipath'];
1172 1133
 		}
@@ -1215,8 +1176,7 @@  discard block
 block discarded – undo
1215 1176
 				$iauthority .= ':' . $this->port;
1216 1177
 			}
1217 1178
 			return $iauthority;
1218
-		}
1219
-		else
1179
+		} else
1220 1180
 		{
1221 1181
 			return null;
1222 1182
 		}
@@ -1230,9 +1190,10 @@  discard block
 block discarded – undo
1230 1190
 	protected function get_authority()
1231 1191
 	{
1232 1192
 		$iauthority = $this->get_iauthority();
1233
-		if (is_string($iauthority))
1234
-			return $this->to_uri($iauthority);
1235
-		else
1236
-			return $iauthority;
1193
+		if (is_string($iauthority)) {
1194
+					return $this->to_uri($iauthority);
1195
+		} else {
1196
+					return $iauthority;
1197
+		}
1237 1198
 	}
1238 1199
 }
Please login to merge, or discard this patch.
src/wp-includes/SimplePie/Item.php 3 patches
Doc Comments   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -860,7 +860,7 @@  discard block
 block discarded – undo
860 860
 	 * @since 1.0
861 861
 	 *
862 862
 	 * @param string $date_format Supports any PHP date format from {@see http://php.net/strftime} (empty for the raw data)
863
-	 * @return int|string|null
863
+	 * @return string|null
864 864
 	 */
865 865
 	public function get_local_date($date_format = '%c')
866 866
 	{
@@ -883,7 +883,7 @@  discard block
 block discarded – undo
883 883
 	 *
884 884
 	 * @see get_date
885 885
 	 * @param string $date_format Supports any PHP date format from {@see http://php.net/date}
886
-	 * @return int|string|null
886
+	 * @return null|string
887 887
 	 */
888 888
 	public function get_gmdate($date_format = 'j F Y, g:i a')
889 889
 	{
@@ -901,7 +901,7 @@  discard block
 block discarded – undo
901 901
 	 *
902 902
 	 * @see get_updated_date
903 903
 	 * @param string $date_format Supports any PHP date format from {@see http://php.net/date}
904
-	 * @return int|string|null
904
+	 * @return null|string
905 905
 	 */
906 906
 	public function get_updated_gmdate($date_format = 'j F Y, g:i a')
907 907
 	{
@@ -2893,7 +2893,7 @@  discard block
 block discarded – undo
2893 2893
 	 * @since 1.0
2894 2894
 	 * @link http://www.w3.org/2003/01/geo/ W3C WGS84 Basic Geo
2895 2895
 	 * @link http://www.georss.org/ GeoRSS
2896
-	 * @return string|null
2896
+	 * @return double|null
2897 2897
 	 */
2898 2898
 	public function get_latitude()
2899 2899
 	{
@@ -2921,7 +2921,7 @@  discard block
 block discarded – undo
2921 2921
 	 * @since 1.0
2922 2922
 	 * @link http://www.w3.org/2003/01/geo/ W3C WGS84 Basic Geo
2923 2923
 	 * @link http://www.georss.org/ GeoRSS
2924
-	 * @return string|null
2924
+	 * @return double|null
2925 2925
 	 */
2926 2926
 	public function get_longitude()
2927 2927
 	{
Please login to merge, or discard this patch.
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
 	 */
123 123
 	public function __destruct()
124 124
 	{
125
-		if ((version_compare(PHP_VERSION, '5.3', '<') || !gc_enabled()) && !ini_get('zend.ze1_compatibility_mode'))
125
+		if ((version_compare(PHP_VERSION, '5.3', '<') || ! gc_enabled()) && ! ini_get('zend.ze1_compatibility_mode'))
126 126
 		{
127 127
 			unset($this->feed);
128 128
 		}
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
 	 */
213 213
 	public function get_id($hash = false)
214 214
 	{
215
-		if (!$hash)
215
+		if ( ! $hash)
216 216
 		{
217 217
 			if ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'id'))
218 218
 			{
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
 		}
250 250
 		if ($this->get_permalink() !== null || $this->get_title() !== null)
251 251
 		{
252
-			return md5($this->get_permalink() . $this->get_title());
252
+			return md5($this->get_permalink().$this->get_title());
253 253
 		}
254 254
 		else
255 255
 		{
@@ -267,7 +267,7 @@  discard block
 block discarded – undo
267 267
 	 */
268 268
 	public function get_title()
269 269
 	{
270
-		if (!isset($this->data['title']))
270
+		if ( ! isset($this->data['title']))
271 271
 		{
272 272
 			if ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'title'))
273 273
 			{
@@ -359,7 +359,7 @@  discard block
 block discarded – undo
359 359
 			return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_HTML);
360 360
 		}
361 361
 
362
-		elseif (!$description_only)
362
+		elseif ( ! $description_only)
363 363
 		{
364 364
 			return $this->get_content(true);
365 365
 		}
@@ -397,7 +397,7 @@  discard block
 block discarded – undo
397 397
 		{
398 398
 			return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_HTML, $this->get_base($return[0]));
399 399
 		}
400
-		elseif (!$content_only)
400
+		elseif ( ! $content_only)
401 401
 		{
402 402
 			return $this->get_description(true);
403 403
 		}
@@ -482,7 +482,7 @@  discard block
 block discarded – undo
482 482
 			$categories[] = $this->registry->create('Category', array($this->sanitize($category['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null));
483 483
 		}
484 484
 
485
-		if (!empty($categories))
485
+		if ( ! empty($categories))
486 486
 		{
487 487
 			return array_unique($categories);
488 488
 		}
@@ -588,7 +588,7 @@  discard block
 block discarded – undo
588 588
 			}
589 589
 		}
590 590
 
591
-		if (!empty($contributors))
591
+		if ( ! empty($contributors))
592 592
 		{
593 593
 			return array_unique($contributors);
594 594
 		}
@@ -670,7 +670,7 @@  discard block
 block discarded – undo
670 670
 			$authors[] = $this->registry->create('Author', array($this->sanitize($author['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null));
671 671
 		}
672 672
 
673
-		if (!empty($authors))
673
+		if ( ! empty($authors))
674 674
 		{
675 675
 			return array_unique($authors);
676 676
 		}
@@ -732,7 +732,7 @@  discard block
 block discarded – undo
732 732
 	 */
733 733
 	public function get_date($date_format = 'j F Y, g:i a')
734 734
 	{
735
-		if (!isset($this->data['date']))
735
+		if ( ! isset($this->data['date']))
736 736
 		{
737 737
 			if ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'published'))
738 738
 			{
@@ -767,7 +767,7 @@  discard block
 block discarded – undo
767 767
 				$this->data['date']['raw'] = $return[0]['data'];
768 768
 			}
769 769
 
770
-			if (!empty($this->data['date']['raw']))
770
+			if ( ! empty($this->data['date']['raw']))
771 771
 			{
772 772
 				$parser = $this->registry->call('Parse_Date', 'get');
773 773
 				$this->data['date']['parsed'] = $parser->parse($this->data['date']['raw']);
@@ -811,14 +811,14 @@  discard block
 block discarded – undo
811 811
 	 */
812 812
 	public function get_updated_date($date_format = 'j F Y, g:i a')
813 813
 	{
814
-		if (!isset($this->data['updated']))
814
+		if ( ! isset($this->data['updated']))
815 815
 		{
816 816
 			if ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'updated'))
817 817
 			{
818 818
 				$this->data['updated']['raw'] = $return[0]['data'];
819 819
 			}
820 820
 
821
-			if (!empty($this->data['updated']['raw']))
821
+			if ( ! empty($this->data['updated']['raw']))
822 822
 			{
823 823
 				$parser = $this->registry->call('Parse_Date', 'get');
824 824
 				$this->data['updated']['parsed'] = $parser->parse($this->data['date']['raw']);
@@ -864,7 +864,7 @@  discard block
 block discarded – undo
864 864
 	 */
865 865
 	public function get_local_date($date_format = '%c')
866 866
 	{
867
-		if (!$date_format)
867
+		if ( ! $date_format)
868 868
 		{
869 869
 			return $this->sanitize($this->get_date(''), SIMPLEPIE_CONSTRUCT_TEXT);
870 870
 		}
@@ -974,7 +974,7 @@  discard block
 block discarded – undo
974 974
 	 */
975 975
 	public function get_links($rel = 'alternate')
976 976
 	{
977
-		if (!isset($this->data['links']))
977
+		if ( ! isset($this->data['links']))
978 978
 		{
979 979
 			$this->data['links'] = array();
980 980
 			foreach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'link') as $link)
@@ -1008,7 +1008,7 @@  discard block
 block discarded – undo
1008 1008
 			}
1009 1009
 			if ($links = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'guid'))
1010 1010
 			{
1011
-				if (!isset($links[0]['attribs']['']['isPermaLink']) || strtolower(trim($links[0]['attribs']['']['isPermaLink'])) === 'true')
1011
+				if ( ! isset($links[0]['attribs']['']['isPermaLink']) || strtolower(trim($links[0]['attribs']['']['isPermaLink'])) === 'true')
1012 1012
 				{
1013 1013
 					$this->data['links']['alternate'][] = $this->sanitize($links[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($links[0]));
1014 1014
 				}
@@ -1019,19 +1019,19 @@  discard block
 block discarded – undo
1019 1019
 			{
1020 1020
 				if ($this->registry->call('Misc', 'is_isegment_nz_nc', array($key)))
1021 1021
 				{
1022
-					if (isset($this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key]))
1022
+					if (isset($this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY.$key]))
1023 1023
 					{
1024
-						$this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key] = array_merge($this->data['links'][$key], $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key]);
1025
-						$this->data['links'][$key] =& $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key];
1024
+						$this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY.$key] = array_merge($this->data['links'][$key], $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY.$key]);
1025
+						$this->data['links'][$key] = & $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY.$key];
1026 1026
 					}
1027 1027
 					else
1028 1028
 					{
1029
-						$this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key] =& $this->data['links'][$key];
1029
+						$this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY.$key] = & $this->data['links'][$key];
1030 1030
 					}
1031 1031
 				}
1032 1032
 				elseif (substr($key, 0, 41) === SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY)
1033 1033
 				{
1034
-					$this->data['links'][substr($key, 41)] =& $this->data['links'][$key];
1034
+					$this->data['links'][substr($key, 41)] = & $this->data['links'][$key];
1035 1035
 				}
1036 1036
 				$this->data['links'][$key] = array_unique($this->data['links'][$key]);
1037 1037
 			}
@@ -1085,7 +1085,7 @@  discard block
 block discarded – undo
1085 1085
 	 */
1086 1086
 	public function get_enclosures()
1087 1087
 	{
1088
-		if (!isset($this->data['enclosures']))
1088
+		if ( ! isset($this->data['enclosures']))
1089 1089
 		{
1090 1090
 			$this->data['enclosures'] = array();
1091 1091
 
@@ -1732,7 +1732,7 @@  discard block
 block discarded – undo
1732 1732
 			// If we have media:group tags, loop through them.
1733 1733
 			foreach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'group') as $group)
1734 1734
 			{
1735
-				if(isset($group['child']) && isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['content']))
1735
+				if (isset($group['child']) && isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['content']))
1736 1736
 				{
1737 1737
 					// If we have media:content tags, loop through them.
1738 1738
 					foreach ((array) $group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['content'] as $content)
@@ -2762,7 +2762,7 @@  discard block
 block discarded – undo
2762 2762
 
2763 2763
 			foreach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'link') as $link)
2764 2764
 			{
2765
-				if (isset($link['attribs']['']['href']) && !empty($link['attribs']['']['rel']) && $link['attribs']['']['rel'] === 'enclosure')
2765
+				if (isset($link['attribs']['']['href']) && ! empty($link['attribs']['']['rel']) && $link['attribs']['']['rel'] === 'enclosure')
2766 2766
 				{
2767 2767
 					// Attributes
2768 2768
 					$bitrate = null;
@@ -2797,7 +2797,7 @@  discard block
 block discarded – undo
2797 2797
 
2798 2798
 			foreach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'link') as $link)
2799 2799
 			{
2800
-				if (isset($link['attribs']['']['href']) && !empty($link['attribs']['']['rel']) && $link['attribs']['']['rel'] === 'enclosure')
2800
+				if (isset($link['attribs']['']['href']) && ! empty($link['attribs']['']['rel']) && $link['attribs']['']['rel'] === 'enclosure')
2801 2801
 				{
2802 2802
 					// Attributes
2803 2803
 					$bitrate = null;
@@ -2873,7 +2873,7 @@  discard block
 block discarded – undo
2873 2873
 
2874 2874
 			$this->data['enclosures'] = array_values(array_unique($this->data['enclosures']));
2875 2875
 		}
2876
-		if (!empty($this->data['enclosures']))
2876
+		if ( ! empty($this->data['enclosures']))
2877 2877
 		{
2878 2878
 			return $this->data['enclosures'];
2879 2879
 		}
Please login to merge, or discard this patch.
Braces   +147 added lines, -295 removed lines patch added patch discarded remove patch
@@ -147,8 +147,7 @@  discard block
 block discarded – undo
147 147
 		if (isset($this->data['child'][$namespace][$tag]))
148 148
 		{
149 149
 			return $this->data['child'][$namespace][$tag];
150
-		}
151
-		else
150
+		} else
152 151
 		{
153 152
 			return null;
154 153
 		}
@@ -217,32 +216,25 @@  discard block
 block discarded – undo
217 216
 			if ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'id'))
218 217
 			{
219 218
 				return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
220
-			}
221
-			elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'id'))
219
+			} elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'id'))
222 220
 			{
223 221
 				return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
224
-			}
225
-			elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'guid'))
222
+			} elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'guid'))
226 223
 			{
227 224
 				return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
228
-			}
229
-			elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_11, 'identifier'))
225
+			} elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_11, 'identifier'))
230 226
 			{
231 227
 				return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
232
-			}
233
-			elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_10, 'identifier'))
228
+			} elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_10, 'identifier'))
234 229
 			{
235 230
 				return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
236
-			}
237
-			elseif (isset($this->data['attribs'][SIMPLEPIE_NAMESPACE_RDF]['about']))
231
+			} elseif (isset($this->data['attribs'][SIMPLEPIE_NAMESPACE_RDF]['about']))
238 232
 			{
239 233
 				return $this->sanitize($this->data['attribs'][SIMPLEPIE_NAMESPACE_RDF]['about'], SIMPLEPIE_CONSTRUCT_TEXT);
240
-			}
241
-			elseif (($return = $this->get_permalink()) !== null)
234
+			} elseif (($return = $this->get_permalink()) !== null)
242 235
 			{
243 236
 				return $return;
244
-			}
245
-			elseif (($return = $this->get_title()) !== null)
237
+			} elseif (($return = $this->get_title()) !== null)
246 238
 			{
247 239
 				return $return;
248 240
 			}
@@ -250,8 +242,7 @@  discard block
 block discarded – undo
250 242
 		if ($this->get_permalink() !== null || $this->get_title() !== null)
251 243
 		{
252 244
 			return md5($this->get_permalink() . $this->get_title());
253
-		}
254
-		else
245
+		} else
255 246
 		{
256 247
 			return md5(serialize($this->data));
257 248
 		}
@@ -272,32 +263,25 @@  discard block
 block discarded – undo
272 263
 			if ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'title'))
273 264
 			{
274 265
 				$this->data['title'] = $this->sanitize($return[0]['data'], $this->registry->call('Misc', 'atom_10_construct_type', array($return[0]['attribs'])), $this->get_base($return[0]));
275
-			}
276
-			elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'title'))
266
+			} elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'title'))
277 267
 			{
278 268
 				$this->data['title'] = $this->sanitize($return[0]['data'], $this->registry->call('Misc', 'atom_03_construct_type', array($return[0]['attribs'])), $this->get_base($return[0]));
279
-			}
280
-			elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_10, 'title'))
269
+			} elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_10, 'title'))
281 270
 			{
282 271
 				$this->data['title'] = $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0]));
283
-			}
284
-			elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_090, 'title'))
272
+			} elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_090, 'title'))
285 273
 			{
286 274
 				$this->data['title'] = $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0]));
287
-			}
288
-			elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'title'))
275
+			} elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'title'))
289 276
 			{
290 277
 				$this->data['title'] = $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0]));
291
-			}
292
-			elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_11, 'title'))
278
+			} elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_11, 'title'))
293 279
 			{
294 280
 				$this->data['title'] = $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
295
-			}
296
-			elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_10, 'title'))
281
+			} elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_10, 'title'))
297 282
 			{
298 283
 				$this->data['title'] = $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
299
-			}
300
-			else
284
+			} else
301 285
 			{
302 286
 				$this->data['title'] = null;
303 287
 			}
@@ -325,45 +309,34 @@  discard block
 block discarded – undo
325 309
 		if ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'summary'))
326 310
 		{
327 311
 			return $this->sanitize($return[0]['data'], $this->registry->call('Misc', 'atom_10_construct_type', array($return[0]['attribs'])), $this->get_base($return[0]));
328
-		}
329
-		elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'summary'))
312
+		} elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'summary'))
330 313
 		{
331 314
 			return $this->sanitize($return[0]['data'], $this->registry->call('Misc', 'atom_03_construct_type', array($return[0]['attribs'])), $this->get_base($return[0]));
332
-		}
333
-		elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_10, 'description'))
315
+		} elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_10, 'description'))
334 316
 		{
335 317
 			return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0]));
336
-		}
337
-		elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'description'))
318
+		} elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'description'))
338 319
 		{
339 320
 			return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_HTML, $this->get_base($return[0]));
340
-		}
341
-		elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_11, 'description'))
321
+		} elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_11, 'description'))
342 322
 		{
343 323
 			return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
344
-		}
345
-		elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_10, 'description'))
324
+		} elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_10, 'description'))
346 325
 		{
347 326
 			return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
348
-		}
349
-		elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'summary'))
327
+		} elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'summary'))
350 328
 		{
351 329
 			return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_HTML, $this->get_base($return[0]));
352
-		}
353
-		elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'subtitle'))
330
+		} elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'subtitle'))
354 331
 		{
355 332
 			return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
356
-		}
357
-		elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_090, 'description'))
333
+		} elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_090, 'description'))
358 334
 		{
359 335
 			return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_HTML);
360
-		}
361
-
362
-		elseif (!$description_only)
336
+		} elseif (!$description_only)
363 337
 		{
364 338
 			return $this->get_content(true);
365
-		}
366
-		else
339
+		} else
367 340
 		{
368 341
 			return null;
369 342
 		}
@@ -388,20 +361,16 @@  discard block
 block discarded – undo
388 361
 		if ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'content'))
389 362
 		{
390 363
 			return $this->sanitize($return[0]['data'], $this->registry->call('Misc', 'atom_10_content_construct_type', array($return[0]['attribs'])), $this->get_base($return[0]));
391
-		}
392
-		elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'content'))
364
+		} elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'content'))
393 365
 		{
394 366
 			return $this->sanitize($return[0]['data'], $this->registry->call('Misc', 'atom_03_construct_type', array($return[0]['attribs'])), $this->get_base($return[0]));
395
-		}
396
-		elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_10_MODULES_CONTENT, 'encoded'))
367
+		} elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_10_MODULES_CONTENT, 'encoded'))
397 368
 		{
398 369
 			return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_HTML, $this->get_base($return[0]));
399
-		}
400
-		elseif (!$content_only)
370
+		} elseif (!$content_only)
401 371
 		{
402 372
 			return $this->get_description(true);
403
-		}
404
-		else
373
+		} else
405 374
 		{
406 375
 			return null;
407 376
 		}
@@ -420,8 +389,7 @@  discard block
 block discarded – undo
420 389
 		if (isset($categories[$key]))
421 390
 		{
422 391
 			return $categories[$key];
423
-		}
424
-		else
392
+		} else
425 393
 		{
426 394
 			return null;
427 395
 		}
@@ -466,8 +434,7 @@  discard block
 block discarded – undo
466 434
 			if (isset($category['attribs']['']['domain']))
467 435
 			{
468 436
 				$scheme = $this->sanitize($category['attribs']['']['domain'], SIMPLEPIE_CONSTRUCT_TEXT);
469
-			}
470
-			else
437
+			} else
471 438
 			{
472 439
 				$scheme = null;
473 440
 			}
@@ -485,8 +452,7 @@  discard block
 block discarded – undo
485 452
 		if (!empty($categories))
486 453
 		{
487 454
 			return array_unique($categories);
488
-		}
489
-		else
455
+		} else
490 456
 		{
491 457
 			return null;
492 458
 		}
@@ -505,8 +471,7 @@  discard block
 block discarded – undo
505 471
 		if (isset($authors[$key]))
506 472
 		{
507 473
 			return $authors[$key];
508
-		}
509
-		else
474
+		} else
510 475
 		{
511 476
 			return null;
512 477
 		}
@@ -525,8 +490,7 @@  discard block
 block discarded – undo
525 490
 		if (isset($contributors[$key]))
526 491
 		{
527 492
 			return $contributors[$key];
528
-		}
529
-		else
493
+		} else
530 494
 		{
531 495
 			return null;
532 496
 		}
@@ -591,8 +555,7 @@  discard block
 block discarded – undo
591 555
 		if (!empty($contributors))
592 556
 		{
593 557
 			return array_unique($contributors);
594
-		}
595
-		else
558
+		} else
596 559
 		{
597 560
 			return null;
598 561
 		}
@@ -673,16 +636,13 @@  discard block
 block discarded – undo
673 636
 		if (!empty($authors))
674 637
 		{
675 638
 			return array_unique($authors);
676
-		}
677
-		elseif (($source = $this->get_source()) && ($authors = $source->get_authors()))
639
+		} elseif (($source = $this->get_source()) && ($authors = $source->get_authors()))
678 640
 		{
679 641
 			return $authors;
680
-		}
681
-		elseif ($authors = $this->feed->get_authors())
642
+		} elseif ($authors = $this->feed->get_authors())
682 643
 		{
683 644
 			return $authors;
684
-		}
685
-		else
645
+		} else
686 646
 		{
687 647
 			return null;
688 648
 		}
@@ -701,16 +661,13 @@  discard block
 block discarded – undo
701 661
 		if ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'rights'))
702 662
 		{
703 663
 			return $this->sanitize($return[0]['data'], $this->registry->call('Misc', 'atom_10_construct_type', array($return[0]['attribs'])), $this->get_base($return[0]));
704
-		}
705
-		elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_11, 'rights'))
664
+		} elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_11, 'rights'))
706 665
 		{
707 666
 			return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
708
-		}
709
-		elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_10, 'rights'))
667
+		} elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_10, 'rights'))
710 668
 		{
711 669
 			return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
712
-		}
713
-		else
670
+		} else
714 671
 		{
715 672
 			return null;
716 673
 		}
@@ -737,32 +694,25 @@  discard block
 block discarded – undo
737 694
 			if ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'published'))
738 695
 			{
739 696
 				$this->data['date']['raw'] = $return[0]['data'];
740
-			}
741
-			elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'updated'))
697
+			} elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'updated'))
742 698
 			{
743 699
 				$this->data['date']['raw'] = $return[0]['data'];
744
-			}
745
-			elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'issued'))
700
+			} elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'issued'))
746 701
 			{
747 702
 				$this->data['date']['raw'] = $return[0]['data'];
748
-			}
749
-			elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'created'))
703
+			} elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'created'))
750 704
 			{
751 705
 				$this->data['date']['raw'] = $return[0]['data'];
752
-			}
753
-			elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'modified'))
706
+			} elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'modified'))
754 707
 			{
755 708
 				$this->data['date']['raw'] = $return[0]['data'];
756
-			}
757
-			elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'pubDate'))
709
+			} elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'pubDate'))
758 710
 			{
759 711
 				$this->data['date']['raw'] = $return[0]['data'];
760
-			}
761
-			elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_11, 'date'))
712
+			} elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_11, 'date'))
762 713
 			{
763 714
 				$this->data['date']['raw'] = $return[0]['data'];
764
-			}
765
-			elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_10, 'date'))
715
+			} elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_10, 'date'))
766 716
 			{
767 717
 				$this->data['date']['raw'] = $return[0]['data'];
768 718
 			}
@@ -771,8 +721,7 @@  discard block
 block discarded – undo
771 721
 			{
772 722
 				$parser = $this->registry->call('Parse_Date', 'get');
773 723
 				$this->data['date']['parsed'] = $parser->parse($this->data['date']['raw']);
774
-			}
775
-			else
724
+			} else
776 725
 			{
777 726
 				$this->data['date'] = null;
778 727
 			}
@@ -791,8 +740,7 @@  discard block
 block discarded – undo
791 740
 				default:
792 741
 					return date($date_format, $this->data['date']['parsed']);
793 742
 			}
794
-		}
795
-		else
743
+		} else
796 744
 		{
797 745
 			return null;
798 746
 		}
@@ -822,8 +770,7 @@  discard block
 block discarded – undo
822 770
 			{
823 771
 				$parser = $this->registry->call('Parse_Date', 'get');
824 772
 				$this->data['updated']['parsed'] = $parser->parse($this->data['date']['raw']);
825
-			}
826
-			else
773
+			} else
827 774
 			{
828 775
 				$this->data['updated'] = null;
829 776
 			}
@@ -842,8 +789,7 @@  discard block
 block discarded – undo
842 789
 				default:
843 790
 					return date($date_format, $this->data['updated']['parsed']);
844 791
 			}
845
-		}
846
-		else
792
+		} else
847 793
 		{
848 794
 			return null;
849 795
 		}
@@ -867,12 +813,10 @@  discard block
 block discarded – undo
867 813
 		if (!$date_format)
868 814
 		{
869 815
 			return $this->sanitize($this->get_date(''), SIMPLEPIE_CONSTRUCT_TEXT);
870
-		}
871
-		elseif (($date = $this->get_date('U')) !== null && $date !== false)
816
+		} elseif (($date = $this->get_date('U')) !== null && $date !== false)
872 817
 		{
873 818
 			return strftime($date_format, $date);
874
-		}
875
-		else
819
+		} else
876 820
 		{
877 821
 			return null;
878 822
 		}
@@ -931,12 +875,10 @@  discard block
 block discarded – undo
931 875
 		if ($link !== null)
932 876
 		{
933 877
 			return $link;
934
-		}
935
-		elseif ($enclosure !== null)
878
+		} elseif ($enclosure !== null)
936 879
 		{
937 880
 			return $enclosure->get_link();
938
-		}
939
-		else
881
+		} else
940 882
 		{
941 883
 			return null;
942 884
 		}
@@ -956,8 +898,7 @@  discard block
 block discarded – undo
956 898
 		if ($links[$key] !== null)
957 899
 		{
958 900
 			return $links[$key];
959
-		}
960
-		else
901
+		} else
961 902
 		{
962 903
 			return null;
963 904
 		}
@@ -1023,13 +964,11 @@  discard block
 block discarded – undo
1023 964
 					{
1024 965
 						$this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key] = array_merge($this->data['links'][$key], $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key]);
1025 966
 						$this->data['links'][$key] =& $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key];
1026
-					}
1027
-					else
967
+					} else
1028 968
 					{
1029 969
 						$this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key] =& $this->data['links'][$key];
1030 970
 					}
1031
-				}
1032
-				elseif (substr($key, 0, 41) === SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY)
971
+				} elseif (substr($key, 0, 41) === SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY)
1033 972
 				{
1034 973
 					$this->data['links'][substr($key, 41)] =& $this->data['links'][$key];
1035 974
 				}
@@ -1039,8 +978,7 @@  discard block
 block discarded – undo
1039 978
 		if (isset($this->data['links'][$rel]))
1040 979
 		{
1041 980
 			return $this->data['links'][$rel];
1042
-		}
1043
-		else
981
+		} else
1044 982
 		{
1045 983
 			return null;
1046 984
 		}
@@ -1062,8 +1000,7 @@  discard block
 block discarded – undo
1062 1000
 		if (isset($enclosures[$key]))
1063 1001
 		{
1064 1002
 			return $enclosures[$key];
1065
-		}
1066
-		else
1003
+		} else
1067 1004
 		{
1068 1005
 			return null;
1069 1006
 		}
@@ -1139,8 +1076,7 @@  discard block
 block discarded – undo
1139 1076
 					}
1140 1077
 					$captions_parent[] = $this->registry->create('Caption', array($caption_type, $caption_lang, $caption_startTime, $caption_endTime, $caption_text));
1141 1078
 				}
1142
-			}
1143
-			elseif ($captions = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'text'))
1079
+			} elseif ($captions = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'text'))
1144 1080
 			{
1145 1081
 				foreach ($captions as $caption)
1146 1082
 				{
@@ -1190,8 +1126,7 @@  discard block
 block discarded – undo
1190 1126
 				if (isset($category['attribs']['']['scheme']))
1191 1127
 				{
1192 1128
 					$scheme = $this->sanitize($category['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT);
1193
-				}
1194
-				else
1129
+				} else
1195 1130
 				{
1196 1131
 					$scheme = 'http://search.yahoo.com/mrss/category_schema';
1197 1132
 				}
@@ -1213,8 +1148,7 @@  discard block
 block discarded – undo
1213 1148
 				if (isset($category['attribs']['']['scheme']))
1214 1149
 				{
1215 1150
 					$scheme = $this->sanitize($category['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT);
1216
-				}
1217
-				else
1151
+				} else
1218 1152
 				{
1219 1153
 					$scheme = 'http://search.yahoo.com/mrss/category_schema';
1220 1154
 				}
@@ -1266,8 +1200,7 @@  discard block
 block discarded – undo
1266 1200
 					$copyright_label = $this->sanitize($copyright[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
1267 1201
 				}
1268 1202
 				$copyrights_parent = $this->registry->create('Copyright', array($copyright_url, $copyright_label));
1269
-			}
1270
-			elseif ($copyright = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'copyright'))
1203
+			} elseif ($copyright = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'copyright'))
1271 1204
 			{
1272 1205
 				$copyright_url = null;
1273 1206
 				$copyright_label = null;
@@ -1297,8 +1230,7 @@  discard block
 block discarded – undo
1297 1230
 					if (isset($credit['attribs']['']['scheme']))
1298 1231
 					{
1299 1232
 						$credit_scheme = $this->sanitize($credit['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT);
1300
-					}
1301
-					else
1233
+					} else
1302 1234
 					{
1303 1235
 						$credit_scheme = 'urn:ebu';
1304 1236
 					}
@@ -1308,8 +1240,7 @@  discard block
 block discarded – undo
1308 1240
 					}
1309 1241
 					$credits_parent[] = $this->registry->create('Credit', array($credit_role, $credit_scheme, $credit_name));
1310 1242
 				}
1311
-			}
1312
-			elseif ($credits = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'credit'))
1243
+			} elseif ($credits = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'credit'))
1313 1244
 			{
1314 1245
 				foreach ($credits as $credit)
1315 1246
 				{
@@ -1323,8 +1254,7 @@  discard block
 block discarded – undo
1323 1254
 					if (isset($credit['attribs']['']['scheme']))
1324 1255
 					{
1325 1256
 						$credit_scheme = $this->sanitize($credit['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT);
1326
-					}
1327
-					else
1257
+					} else
1328 1258
 					{
1329 1259
 						$credit_scheme = 'urn:ebu';
1330 1260
 					}
@@ -1347,8 +1277,7 @@  discard block
 block discarded – undo
1347 1277
 				{
1348 1278
 					$description_parent = $this->sanitize($description_parent[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
1349 1279
 				}
1350
-			}
1351
-			elseif ($description_parent = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'description'))
1280
+			} elseif ($description_parent = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'description'))
1352 1281
 			{
1353 1282
 				if (isset($description_parent[0]['data']))
1354 1283
 				{
@@ -1398,15 +1327,13 @@  discard block
 block discarded – undo
1398 1327
 					if (isset($hash['attribs']['']['algo']))
1399 1328
 					{
1400 1329
 						$algo = $this->sanitize($hash['attribs']['']['algo'], SIMPLEPIE_CONSTRUCT_TEXT);
1401
-					}
1402
-					else
1330
+					} else
1403 1331
 					{
1404 1332
 						$algo = 'md5';
1405 1333
 					}
1406 1334
 					$hashes_parent[] = $algo.':'.$value;
1407 1335
 				}
1408
-			}
1409
-			elseif ($hashes_iterator = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'hash'))
1336
+			} elseif ($hashes_iterator = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'hash'))
1410 1337
 			{
1411 1338
 				foreach ($hashes_iterator as $hash)
1412 1339
 				{
@@ -1419,8 +1346,7 @@  discard block
 block discarded – undo
1419 1346
 					if (isset($hash['attribs']['']['algo']))
1420 1347
 					{
1421 1348
 						$algo = $this->sanitize($hash['attribs']['']['algo'], SIMPLEPIE_CONSTRUCT_TEXT);
1422
-					}
1423
-					else
1349
+					} else
1424 1350
 					{
1425 1351
 						$algo = 'md5';
1426 1352
 					}
@@ -1444,8 +1370,7 @@  discard block
 block discarded – undo
1444 1370
 					}
1445 1371
 				}
1446 1372
 				unset($temp);
1447
-			}
1448
-			elseif ($keywords = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'keywords'))
1373
+			} elseif ($keywords = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'keywords'))
1449 1374
 			{
1450 1375
 				if (isset($keywords[0]['data']))
1451 1376
 				{
@@ -1456,8 +1381,7 @@  discard block
 block discarded – undo
1456 1381
 					}
1457 1382
 				}
1458 1383
 				unset($temp);
1459
-			}
1460
-			elseif ($keywords = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'keywords'))
1384
+			} elseif ($keywords = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'keywords'))
1461 1385
 			{
1462 1386
 				if (isset($keywords[0]['data']))
1463 1387
 				{
@@ -1468,8 +1392,7 @@  discard block
 block discarded – undo
1468 1392
 					}
1469 1393
 				}
1470 1394
 				unset($temp);
1471
-			}
1472
-			elseif ($keywords = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'keywords'))
1395
+			} elseif ($keywords = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'keywords'))
1473 1396
 			{
1474 1397
 				if (isset($keywords[0]['data']))
1475 1398
 				{
@@ -1493,8 +1416,7 @@  discard block
 block discarded – undo
1493 1416
 				{
1494 1417
 					$player_parent = $this->sanitize($player_parent[0]['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_IRI);
1495 1418
 				}
1496
-			}
1497
-			elseif ($player_parent = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'player'))
1419
+			} elseif ($player_parent = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'player'))
1498 1420
 			{
1499 1421
 				if (isset($player_parent[0]['attribs']['']['url']))
1500 1422
 				{
@@ -1512,8 +1434,7 @@  discard block
 block discarded – undo
1512 1434
 					if (isset($rating['attribs']['']['scheme']))
1513 1435
 					{
1514 1436
 						$rating_scheme = $this->sanitize($rating['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT);
1515
-					}
1516
-					else
1437
+					} else
1517 1438
 					{
1518 1439
 						$rating_scheme = 'urn:simple';
1519 1440
 					}
@@ -1523,8 +1444,7 @@  discard block
 block discarded – undo
1523 1444
 					}
1524 1445
 					$ratings_parent[] = $this->registry->create('Rating', array($rating_scheme, $rating_value));
1525 1446
 				}
1526
-			}
1527
-			elseif ($ratings = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'explicit'))
1447
+			} elseif ($ratings = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'explicit'))
1528 1448
 			{
1529 1449
 				foreach ($ratings as $rating)
1530 1450
 				{
@@ -1536,8 +1456,7 @@  discard block
 block discarded – undo
1536 1456
 					}
1537 1457
 					$ratings_parent[] = $this->registry->create('Rating', array($rating_scheme, $rating_value));
1538 1458
 				}
1539
-			}
1540
-			elseif ($ratings = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'rating'))
1459
+			} elseif ($ratings = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'rating'))
1541 1460
 			{
1542 1461
 				foreach ($ratings as $rating)
1543 1462
 				{
@@ -1546,8 +1465,7 @@  discard block
 block discarded – undo
1546 1465
 					if (isset($rating['attribs']['']['scheme']))
1547 1466
 					{
1548 1467
 						$rating_scheme = $this->sanitize($rating['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT);
1549
-					}
1550
-					else
1468
+					} else
1551 1469
 					{
1552 1470
 						$rating_scheme = 'urn:simple';
1553 1471
 					}
@@ -1557,8 +1475,7 @@  discard block
 block discarded – undo
1557 1475
 					}
1558 1476
 					$ratings_parent[] = $this->registry->create('Rating', array($rating_scheme, $rating_value));
1559 1477
 				}
1560
-			}
1561
-			elseif ($ratings = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'explicit'))
1478
+			} elseif ($ratings = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'explicit'))
1562 1479
 			{
1563 1480
 				foreach ($ratings as $rating)
1564 1481
 				{
@@ -1598,8 +1515,7 @@  discard block
 block discarded – undo
1598 1515
 					}
1599 1516
 					$restrictions_parent[] = $this->registry->create('Restriction', array($restriction_relationship, $restriction_type, $restriction_value));
1600 1517
 				}
1601
-			}
1602
-			elseif ($restrictions = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'block'))
1518
+			} elseif ($restrictions = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'block'))
1603 1519
 			{
1604 1520
 				foreach ($restrictions as $restriction)
1605 1521
 				{
@@ -1612,8 +1528,7 @@  discard block
 block discarded – undo
1612 1528
 					}
1613 1529
 					$restrictions_parent[] = $this->registry->create('Restriction', array($restriction_relationship, $restriction_type, $restriction_value));
1614 1530
 				}
1615
-			}
1616
-			elseif ($restrictions = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'restriction'))
1531
+			} elseif ($restrictions = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'restriction'))
1617 1532
 			{
1618 1533
 				foreach ($restrictions as $restriction)
1619 1534
 				{
@@ -1634,8 +1549,7 @@  discard block
 block discarded – undo
1634 1549
 					}
1635 1550
 					$restrictions_parent[] = $this->registry->create('Restriction', array($restriction_relationship, $restriction_type, $restriction_value));
1636 1551
 				}
1637
-			}
1638
-			elseif ($restrictions = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'block'))
1552
+			} elseif ($restrictions = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'block'))
1639 1553
 			{
1640 1554
 				foreach ($restrictions as $restriction)
1641 1555
 				{
@@ -1652,8 +1566,7 @@  discard block
 block discarded – undo
1652 1566
 			if (is_array($restrictions_parent))
1653 1567
 			{
1654 1568
 				$restrictions_parent = array_values(array_unique($restrictions_parent));
1655
-			}
1656
-			else
1569
+			} else
1657 1570
 			{
1658 1571
 				$restrictions_parent = array(new SimplePie_Restriction('allow', null, 'default'));
1659 1572
 			}
@@ -1668,8 +1581,7 @@  discard block
 block discarded – undo
1668 1581
 						$thumbnails_parent[] = $this->sanitize($thumbnail['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_IRI);
1669 1582
 					}
1670 1583
 				}
1671
-			}
1672
-			elseif ($thumbnails = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'thumbnail'))
1584
+			} elseif ($thumbnails = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'thumbnail'))
1673 1585
 			{
1674 1586
 				foreach ($thumbnails as $thumbnail)
1675 1587
 				{
@@ -1687,8 +1599,7 @@  discard block
 block discarded – undo
1687 1599
 				{
1688 1600
 					$title_parent = $this->sanitize($title_parent[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
1689 1601
 				}
1690
-			}
1691
-			elseif ($title_parent = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'title'))
1602
+			} elseif ($title_parent = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'title'))
1692 1603
 			{
1693 1604
 				if (isset($title_parent[0]['data']))
1694 1605
 				{
@@ -1781,8 +1692,7 @@  discard block
 block discarded – undo
1781 1692
 							if (isset($content['attribs']['']['duration']))
1782 1693
 							{
1783 1694
 								$duration = $this->sanitize($content['attribs']['']['duration'], SIMPLEPIE_CONSTRUCT_TEXT);
1784
-							}
1785
-							else
1695
+							} else
1786 1696
 							{
1787 1697
 								$duration = $duration_parent;
1788 1698
 							}
@@ -1862,8 +1772,7 @@  discard block
 block discarded – undo
1862 1772
 								{
1863 1773
 									$captions = array_values(array_unique($captions));
1864 1774
 								}
1865
-							}
1866
-							elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['text']))
1775
+							} elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['text']))
1867 1776
 							{
1868 1777
 								foreach ($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['text'] as $caption)
1869 1778
 								{
@@ -1898,8 +1807,7 @@  discard block
 block discarded – undo
1898 1807
 								{
1899 1808
 									$captions = array_values(array_unique($captions));
1900 1809
 								}
1901
-							}
1902
-							else
1810
+							} else
1903 1811
 							{
1904 1812
 								$captions = $captions_parent;
1905 1813
 							}
@@ -1919,8 +1827,7 @@  discard block
 block discarded – undo
1919 1827
 									if (isset($category['attribs']['']['scheme']))
1920 1828
 									{
1921 1829
 										$scheme = $this->sanitize($category['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT);
1922
-									}
1923
-									else
1830
+									} else
1924 1831
 									{
1925 1832
 										$scheme = 'http://search.yahoo.com/mrss/category_schema';
1926 1833
 									}
@@ -1945,8 +1852,7 @@  discard block
 block discarded – undo
1945 1852
 									if (isset($category['attribs']['']['scheme']))
1946 1853
 									{
1947 1854
 										$scheme = $this->sanitize($category['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT);
1948
-									}
1949
-									else
1855
+									} else
1950 1856
 									{
1951 1857
 										$scheme = 'http://search.yahoo.com/mrss/category_schema';
1952 1858
 									}
@@ -1960,12 +1866,10 @@  discard block
 block discarded – undo
1960 1866
 							if (is_array($categories) && is_array($categories_parent))
1961 1867
 							{
1962 1868
 								$categories = array_values(array_unique(array_merge($categories, $categories_parent)));
1963
-							}
1964
-							elseif (is_array($categories))
1869
+							} elseif (is_array($categories))
1965 1870
 							{
1966 1871
 								$categories = array_values(array_unique($categories));
1967
-							}
1968
-							elseif (is_array($categories_parent))
1872
+							} elseif (is_array($categories_parent))
1969 1873
 							{
1970 1874
 								$categories = array_values(array_unique($categories_parent));
1971 1875
 							}
@@ -1984,8 +1888,7 @@  discard block
 block discarded – undo
1984 1888
 									$copyright_label = $this->sanitize($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
1985 1889
 								}
1986 1890
 								$copyrights = $this->registry->create('Copyright', array($copyright_url, $copyright_label));
1987
-							}
1988
-							elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright']))
1891
+							} elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright']))
1989 1892
 							{
1990 1893
 								$copyright_url = null;
1991 1894
 								$copyright_label = null;
@@ -1998,8 +1901,7 @@  discard block
 block discarded – undo
1998 1901
 									$copyright_label = $this->sanitize($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
1999 1902
 								}
2000 1903
 								$copyrights = $this->registry->create('Copyright', array($copyright_url, $copyright_label));
2001
-							}
2002
-							else
1904
+							} else
2003 1905
 							{
2004 1906
 								$copyrights = $copyrights_parent;
2005 1907
 							}
@@ -2019,8 +1921,7 @@  discard block
 block discarded – undo
2019 1921
 									if (isset($credit['attribs']['']['scheme']))
2020 1922
 									{
2021 1923
 										$credit_scheme = $this->sanitize($credit['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT);
2022
-									}
2023
-									else
1924
+									} else
2024 1925
 									{
2025 1926
 										$credit_scheme = 'urn:ebu';
2026 1927
 									}
@@ -2034,8 +1935,7 @@  discard block
 block discarded – undo
2034 1935
 								{
2035 1936
 									$credits = array_values(array_unique($credits));
2036 1937
 								}
2037
-							}
2038
-							elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['credit']))
1938
+							} elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['credit']))
2039 1939
 							{
2040 1940
 								foreach ($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['credit'] as $credit)
2041 1941
 								{
@@ -2049,8 +1949,7 @@  discard block
 block discarded – undo
2049 1949
 									if (isset($credit['attribs']['']['scheme']))
2050 1950
 									{
2051 1951
 										$credit_scheme = $this->sanitize($credit['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT);
2052
-									}
2053
-									else
1952
+									} else
2054 1953
 									{
2055 1954
 										$credit_scheme = 'urn:ebu';
2056 1955
 									}
@@ -2064,8 +1963,7 @@  discard block
 block discarded – undo
2064 1963
 								{
2065 1964
 									$credits = array_values(array_unique($credits));
2066 1965
 								}
2067
-							}
2068
-							else
1966
+							} else
2069 1967
 							{
2070 1968
 								$credits = $credits_parent;
2071 1969
 							}
@@ -2074,12 +1972,10 @@  discard block
 block discarded – undo
2074 1972
 							if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['description']))
2075 1973
 							{
2076 1974
 								$description = $this->sanitize($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['description'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
2077
-							}
2078
-							elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['description']))
1975
+							} elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['description']))
2079 1976
 							{
2080 1977
 								$description = $this->sanitize($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['description'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
2081
-							}
2082
-							else
1978
+							} else
2083 1979
 							{
2084 1980
 								$description = $description_parent;
2085 1981
 							}
@@ -2098,8 +1994,7 @@  discard block
 block discarded – undo
2098 1994
 									if (isset($hash['attribs']['']['algo']))
2099 1995
 									{
2100 1996
 										$algo = $this->sanitize($hash['attribs']['']['algo'], SIMPLEPIE_CONSTRUCT_TEXT);
2101
-									}
2102
-									else
1997
+									} else
2103 1998
 									{
2104 1999
 										$algo = 'md5';
2105 2000
 									}
@@ -2109,8 +2004,7 @@  discard block
 block discarded – undo
2109 2004
 								{
2110 2005
 									$hashes = array_values(array_unique($hashes));
2111 2006
 								}
2112
-							}
2113
-							elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['hash']))
2007
+							} elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['hash']))
2114 2008
 							{
2115 2009
 								foreach ($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['hash'] as $hash)
2116 2010
 								{
@@ -2123,8 +2017,7 @@  discard block
 block discarded – undo
2123 2017
 									if (isset($hash['attribs']['']['algo']))
2124 2018
 									{
2125 2019
 										$algo = $this->sanitize($hash['attribs']['']['algo'], SIMPLEPIE_CONSTRUCT_TEXT);
2126
-									}
2127
-									else
2020
+									} else
2128 2021
 									{
2129 2022
 										$algo = 'md5';
2130 2023
 									}
@@ -2134,8 +2027,7 @@  discard block
 block discarded – undo
2134 2027
 								{
2135 2028
 									$hashes = array_values(array_unique($hashes));
2136 2029
 								}
2137
-							}
2138
-							else
2030
+							} else
2139 2031
 							{
2140 2032
 								$hashes = $hashes_parent;
2141 2033
 							}
@@ -2156,8 +2048,7 @@  discard block
 block discarded – undo
2156 2048
 								{
2157 2049
 									$keywords = array_values(array_unique($keywords));
2158 2050
 								}
2159
-							}
2160
-							elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['keywords']))
2051
+							} elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['keywords']))
2161 2052
 							{
2162 2053
 								if (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['keywords'][0]['data']))
2163 2054
 								{
@@ -2172,8 +2063,7 @@  discard block
 block discarded – undo
2172 2063
 								{
2173 2064
 									$keywords = array_values(array_unique($keywords));
2174 2065
 								}
2175
-							}
2176
-							else
2066
+							} else
2177 2067
 							{
2178 2068
 								$keywords = $keywords_parent;
2179 2069
 							}
@@ -2182,12 +2072,10 @@  discard block
 block discarded – undo
2182 2072
 							if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['player']))
2183 2073
 							{
2184 2074
 								$player = $this->sanitize($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['player'][0]['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_IRI);
2185
-							}
2186
-							elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['player']))
2075
+							} elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['player']))
2187 2076
 							{
2188 2077
 								$player = $this->sanitize($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['player'][0]['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_IRI);
2189
-							}
2190
-							else
2078
+							} else
2191 2079
 							{
2192 2080
 								$player = $player_parent;
2193 2081
 							}
@@ -2202,8 +2090,7 @@  discard block
 block discarded – undo
2202 2090
 									if (isset($rating['attribs']['']['scheme']))
2203 2091
 									{
2204 2092
 										$rating_scheme = $this->sanitize($rating['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT);
2205
-									}
2206
-									else
2093
+									} else
2207 2094
 									{
2208 2095
 										$rating_scheme = 'urn:simple';
2209 2096
 									}
@@ -2217,8 +2104,7 @@  discard block
 block discarded – undo
2217 2104
 								{
2218 2105
 									$ratings = array_values(array_unique($ratings));
2219 2106
 								}
2220
-							}
2221
-							elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['rating']))
2107
+							} elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['rating']))
2222 2108
 							{
2223 2109
 								foreach ($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['rating'] as $rating)
2224 2110
 								{
@@ -2227,8 +2113,7 @@  discard block
 block discarded – undo
2227 2113
 									if (isset($rating['attribs']['']['scheme']))
2228 2114
 									{
2229 2115
 										$rating_scheme = $this->sanitize($rating['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT);
2230
-									}
2231
-									else
2116
+									} else
2232 2117
 									{
2233 2118
 										$rating_scheme = 'urn:simple';
2234 2119
 									}
@@ -2242,8 +2127,7 @@  discard block
 block discarded – undo
2242 2127
 								{
2243 2128
 									$ratings = array_values(array_unique($ratings));
2244 2129
 								}
2245
-							}
2246
-							else
2130
+							} else
2247 2131
 							{
2248 2132
 								$ratings = $ratings_parent;
2249 2133
 							}
@@ -2274,8 +2158,7 @@  discard block
 block discarded – undo
2274 2158
 								{
2275 2159
 									$restrictions = array_values(array_unique($restrictions));
2276 2160
 								}
2277
-							}
2278
-							elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['restriction']))
2161
+							} elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['restriction']))
2279 2162
 							{
2280 2163
 								foreach ($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['restriction'] as $restriction)
2281 2164
 								{
@@ -2300,8 +2183,7 @@  discard block
 block discarded – undo
2300 2183
 								{
2301 2184
 									$restrictions = array_values(array_unique($restrictions));
2302 2185
 								}
2303
-							}
2304
-							else
2186
+							} else
2305 2187
 							{
2306 2188
 								$restrictions = $restrictions_parent;
2307 2189
 							}
@@ -2317,8 +2199,7 @@  discard block
 block discarded – undo
2317 2199
 								{
2318 2200
 									$thumbnails = array_values(array_unique($thumbnails));
2319 2201
 								}
2320
-							}
2321
-							elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['thumbnail']))
2202
+							} elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['thumbnail']))
2322 2203
 							{
2323 2204
 								foreach ($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['thumbnail'] as $thumbnail)
2324 2205
 								{
@@ -2328,8 +2209,7 @@  discard block
 block discarded – undo
2328 2209
 								{
2329 2210
 									$thumbnails = array_values(array_unique($thumbnails));
2330 2211
 								}
2331
-							}
2332
-							else
2212
+							} else
2333 2213
 							{
2334 2214
 								$thumbnails = $thumbnails_parent;
2335 2215
 							}
@@ -2338,12 +2218,10 @@  discard block
 block discarded – undo
2338 2218
 							if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['title']))
2339 2219
 							{
2340 2220
 								$title = $this->sanitize($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['title'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
2341
-							}
2342
-							elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['title']))
2221
+							} elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['title']))
2343 2222
 							{
2344 2223
 								$title = $this->sanitize($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['title'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
2345
-							}
2346
-							else
2224
+							} else
2347 2225
 							{
2348 2226
 								$title = $title_parent;
2349 2227
 							}
@@ -2403,8 +2281,7 @@  discard block
 block discarded – undo
2403 2281
 						if (isset($content['attribs']['']['duration']))
2404 2282
 						{
2405 2283
 							$duration = $this->sanitize($content['attribs']['']['duration'], SIMPLEPIE_CONSTRUCT_TEXT);
2406
-						}
2407
-						else
2284
+						} else
2408 2285
 						{
2409 2286
 							$duration = $duration_parent;
2410 2287
 						}
@@ -2486,8 +2363,7 @@  discard block
 block discarded – undo
2486 2363
 							{
2487 2364
 								$captions = array_values(array_unique($captions));
2488 2365
 							}
2489
-						}
2490
-						else
2366
+						} else
2491 2367
 						{
2492 2368
 							$captions = $captions_parent;
2493 2369
 						}
@@ -2507,8 +2383,7 @@  discard block
 block discarded – undo
2507 2383
 								if (isset($category['attribs']['']['scheme']))
2508 2384
 								{
2509 2385
 									$scheme = $this->sanitize($category['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT);
2510
-								}
2511
-								else
2386
+								} else
2512 2387
 								{
2513 2388
 									$scheme = 'http://search.yahoo.com/mrss/category_schema';
2514 2389
 								}
@@ -2522,16 +2397,13 @@  discard block
 block discarded – undo
2522 2397
 						if (is_array($categories) && is_array($categories_parent))
2523 2398
 						{
2524 2399
 							$categories = array_values(array_unique(array_merge($categories, $categories_parent)));
2525
-						}
2526
-						elseif (is_array($categories))
2400
+						} elseif (is_array($categories))
2527 2401
 						{
2528 2402
 							$categories = array_values(array_unique($categories));
2529
-						}
2530
-						elseif (is_array($categories_parent))
2403
+						} elseif (is_array($categories_parent))
2531 2404
 						{
2532 2405
 							$categories = array_values(array_unique($categories_parent));
2533
-						}
2534
-						else
2406
+						} else
2535 2407
 						{
2536 2408
 							$categories = null;
2537 2409
 						}
@@ -2550,8 +2422,7 @@  discard block
 block discarded – undo
2550 2422
 								$copyright_label = $this->sanitize($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
2551 2423
 							}
2552 2424
 							$copyrights = $this->registry->create('Copyright', array($copyright_url, $copyright_label));
2553
-						}
2554
-						else
2425
+						} else
2555 2426
 						{
2556 2427
 							$copyrights = $copyrights_parent;
2557 2428
 						}
@@ -2571,8 +2442,7 @@  discard block
 block discarded – undo
2571 2442
 								if (isset($credit['attribs']['']['scheme']))
2572 2443
 								{
2573 2444
 									$credit_scheme = $this->sanitize($credit['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT);
2574
-								}
2575
-								else
2445
+								} else
2576 2446
 								{
2577 2447
 									$credit_scheme = 'urn:ebu';
2578 2448
 								}
@@ -2586,8 +2456,7 @@  discard block
 block discarded – undo
2586 2456
 							{
2587 2457
 								$credits = array_values(array_unique($credits));
2588 2458
 							}
2589
-						}
2590
-						else
2459
+						} else
2591 2460
 						{
2592 2461
 							$credits = $credits_parent;
2593 2462
 						}
@@ -2596,8 +2465,7 @@  discard block
 block discarded – undo
2596 2465
 						if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['description']))
2597 2466
 						{
2598 2467
 							$description = $this->sanitize($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['description'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
2599
-						}
2600
-						else
2468
+						} else
2601 2469
 						{
2602 2470
 							$description = $description_parent;
2603 2471
 						}
@@ -2616,8 +2484,7 @@  discard block
 block discarded – undo
2616 2484
 								if (isset($hash['attribs']['']['algo']))
2617 2485
 								{
2618 2486
 									$algo = $this->sanitize($hash['attribs']['']['algo'], SIMPLEPIE_CONSTRUCT_TEXT);
2619
-								}
2620
-								else
2487
+								} else
2621 2488
 								{
2622 2489
 									$algo = 'md5';
2623 2490
 								}
@@ -2627,8 +2494,7 @@  discard block
 block discarded – undo
2627 2494
 							{
2628 2495
 								$hashes = array_values(array_unique($hashes));
2629 2496
 							}
2630
-						}
2631
-						else
2497
+						} else
2632 2498
 						{
2633 2499
 							$hashes = $hashes_parent;
2634 2500
 						}
@@ -2649,8 +2515,7 @@  discard block
 block discarded – undo
2649 2515
 							{
2650 2516
 								$keywords = array_values(array_unique($keywords));
2651 2517
 							}
2652
-						}
2653
-						else
2518
+						} else
2654 2519
 						{
2655 2520
 							$keywords = $keywords_parent;
2656 2521
 						}
@@ -2659,8 +2524,7 @@  discard block
 block discarded – undo
2659 2524
 						if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['player']))
2660 2525
 						{
2661 2526
 							$player = $this->sanitize($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['player'][0]['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_IRI);
2662
-						}
2663
-						else
2527
+						} else
2664 2528
 						{
2665 2529
 							$player = $player_parent;
2666 2530
 						}
@@ -2675,8 +2539,7 @@  discard block
 block discarded – undo
2675 2539
 								if (isset($rating['attribs']['']['scheme']))
2676 2540
 								{
2677 2541
 									$rating_scheme = $this->sanitize($rating['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT);
2678
-								}
2679
-								else
2542
+								} else
2680 2543
 								{
2681 2544
 									$rating_scheme = 'urn:simple';
2682 2545
 								}
@@ -2690,8 +2553,7 @@  discard block
 block discarded – undo
2690 2553
 							{
2691 2554
 								$ratings = array_values(array_unique($ratings));
2692 2555
 							}
2693
-						}
2694
-						else
2556
+						} else
2695 2557
 						{
2696 2558
 							$ratings = $ratings_parent;
2697 2559
 						}
@@ -2722,8 +2584,7 @@  discard block
 block discarded – undo
2722 2584
 							{
2723 2585
 								$restrictions = array_values(array_unique($restrictions));
2724 2586
 							}
2725
-						}
2726
-						else
2587
+						} else
2727 2588
 						{
2728 2589
 							$restrictions = $restrictions_parent;
2729 2590
 						}
@@ -2739,8 +2600,7 @@  discard block
 block discarded – undo
2739 2600
 							{
2740 2601
 								$thumbnails = array_values(array_unique($thumbnails));
2741 2602
 							}
2742
-						}
2743
-						else
2603
+						} else
2744 2604
 						{
2745 2605
 							$thumbnails = $thumbnails_parent;
2746 2606
 						}
@@ -2749,8 +2609,7 @@  discard block
 block discarded – undo
2749 2609
 						if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['title']))
2750 2610
 						{
2751 2611
 							$title = $this->sanitize($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['title'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
2752
-						}
2753
-						else
2612
+						} else
2754 2613
 						{
2755 2614
 							$title = $title_parent;
2756 2615
 						}
@@ -2876,8 +2735,7 @@  discard block
 block discarded – undo
2876 2735
 		if (!empty($this->data['enclosures']))
2877 2736
 		{
2878 2737
 			return $this->data['enclosures'];
2879
-		}
2880
-		else
2738
+		} else
2881 2739
 		{
2882 2740
 			return null;
2883 2741
 		}
@@ -2900,12 +2758,10 @@  discard block
 block discarded – undo
2900 2758
 		if ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_W3C_BASIC_GEO, 'lat'))
2901 2759
 		{
2902 2760
 			return (float) $return[0]['data'];
2903
-		}
2904
-		elseif (($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_GEORSS, 'point')) && preg_match('/^((?:-)?[0-9]+(?:\.[0-9]+)) ((?:-)?[0-9]+(?:\.[0-9]+))$/', trim($return[0]['data']), $match))
2761
+		} elseif (($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_GEORSS, 'point')) && preg_match('/^((?:-)?[0-9]+(?:\.[0-9]+)) ((?:-)?[0-9]+(?:\.[0-9]+))$/', trim($return[0]['data']), $match))
2905 2762
 		{
2906 2763
 			return (float) $match[1];
2907
-		}
2908
-		else
2764
+		} else
2909 2765
 		{
2910 2766
 			return null;
2911 2767
 		}
@@ -2928,16 +2784,13 @@  discard block
 block discarded – undo
2928 2784
 		if ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_W3C_BASIC_GEO, 'long'))
2929 2785
 		{
2930 2786
 			return (float) $return[0]['data'];
2931
-		}
2932
-		elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_W3C_BASIC_GEO, 'lon'))
2787
+		} elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_W3C_BASIC_GEO, 'lon'))
2933 2788
 		{
2934 2789
 			return (float) $return[0]['data'];
2935
-		}
2936
-		elseif (($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_GEORSS, 'point')) && preg_match('/^((?:-)?[0-9]+(?:\.[0-9]+)) ((?:-)?[0-9]+(?:\.[0-9]+))$/', trim($return[0]['data']), $match))
2790
+		} elseif (($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_GEORSS, 'point')) && preg_match('/^((?:-)?[0-9]+(?:\.[0-9]+)) ((?:-)?[0-9]+(?:\.[0-9]+))$/', trim($return[0]['data']), $match))
2937 2791
 		{
2938 2792
 			return (float) $match[2];
2939
-		}
2940
-		else
2793
+		} else
2941 2794
 		{
2942 2795
 			return null;
2943 2796
 		}
@@ -2954,8 +2807,7 @@  discard block
 block discarded – undo
2954 2807
 		if ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'source'))
2955 2808
 		{
2956 2809
 			return $this->registry->create('Source', array($this, $return[0]));
2957
-		}
2958
-		else
2810
+		} else
2959 2811
 		{
2960 2812
 			return null;
2961 2813
 		}
Please login to merge, or discard this patch.
src/wp-includes/SimplePie/Locator.php 3 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -210,6 +210,9 @@
 block discarded – undo
210 210
 		}
211 211
 	}
212 212
 
213
+	/**
214
+	 * @param string $name
215
+	 */
213 216
 	protected function search_elements_by_tag($name, &$done, $feeds)
214 217
 	{
215 218
 		if ($this->dom === null)
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
 		$feeds = array_merge($feeds, $this->search_elements_by_tag('a', $done, $feeds));
201 201
 		$feeds = array_merge($feeds, $this->search_elements_by_tag('area', $done, $feeds));
202 202
 
203
-		if (!empty($feeds))
203
+		if ( ! empty($feeds))
204 204
 		{
205 205
 			return array_values($feeds);
206 206
 		}
@@ -242,7 +242,7 @@  discard block
 block discarded – undo
242 242
 					continue;
243 243
 				}
244 244
 
245
-				if (!in_array($href, $done) && in_array('feed', $rel) || (in_array('alternate', $rel) && !in_array('stylesheet', $rel) && $link->hasAttribute('type') && in_array(strtolower($this->registry->call('Misc', 'parse_mime', array($link->getAttribute('type')))), array('application/rss+xml', 'application/atom+xml'))) && !isset($feeds[$href]))
245
+				if ( ! in_array($href, $done) && in_array('feed', $rel) || (in_array('alternate', $rel) && ! in_array('stylesheet', $rel) && $link->hasAttribute('type') && in_array(strtolower($this->registry->call('Misc', 'parse_mime', array($link->getAttribute('type')))), array('application/rss+xml', 'application/atom+xml'))) && ! isset($feeds[$href]))
246 246
 				{
247 247
 					$this->checked_feeds++;
248 248
 					$headers = array(
@@ -305,7 +305,7 @@  discard block
 block discarded – undo
305 305
 		}
306 306
 		$this->local = array_unique($this->local);
307 307
 		$this->elsewhere = array_unique($this->elsewhere);
308
-		if (!empty($this->local) || !empty($this->elsewhere))
308
+		if ( ! empty($this->local) || ! empty($this->elsewhere))
309 309
 		{
310 310
 			return true;
311 311
 		}
Please login to merge, or discard this patch.
Braces   +10 added lines, -20 removed lines patch added patch discarded remove patch
@@ -79,8 +79,7 @@  discard block
 block discarded – undo
79 79
 			set_error_handler(array('SimplePie_Misc', 'silence_errors'));
80 80
 			$this->dom->loadHTML($this->file->body);
81 81
 			restore_error_handler();
82
-		}
83
-		else
82
+		} else
84 83
 		{
85 84
 			$this->dom = null;
86 85
 		}
@@ -151,17 +150,14 @@  discard block
 block discarded – undo
151 150
 			if (in_array($sniffed, array('application/rss+xml', 'application/rdf+xml', 'text/rdf', 'application/atom+xml', 'text/xml', 'application/xml')))
152 151
 			{
153 152
 				return true;
154
-			}
155
-			else
153
+			} else
156 154
 			{
157 155
 				return false;
158 156
 			}
159
-		}
160
-		elseif ($file->method & SIMPLEPIE_FILE_SOURCE_LOCAL)
157
+		} elseif ($file->method & SIMPLEPIE_FILE_SOURCE_LOCAL)
161 158
 		{
162 159
 			return true;
163
-		}
164
-		else
160
+		} else
165 161
 		{
166 162
 			return false;
167 163
 		}
@@ -203,8 +199,7 @@  discard block
 block discarded – undo
203 199
 		if (!empty($feeds))
204 200
 		{
205 201
 			return array_values($feeds);
206
-		}
207
-		else
202
+		} else
208 203
 		{
209 204
 			return null;
210 205
 		}
@@ -232,8 +227,7 @@  discard block
 block discarded – undo
232 227
 				if ($this->base_location < $line)
233 228
 				{
234 229
 					$href = $this->registry->call('Misc', 'absolutize_url', array(trim($link->getAttribute('href')), $this->base));
235
-				}
236
-				else
230
+				} else
237 231
 				{
238 232
 					$href = $this->registry->call('Misc', 'absolutize_url', array(trim($link->getAttribute('href')), $this->http_base));
239 233
 				}
@@ -280,8 +274,7 @@  discard block
 block discarded – undo
280 274
 					if (method_exists($link, 'getLineNo') && $this->base_location < $link->getLineNo())
281 275
 					{
282 276
 						$href = $this->registry->call('Misc', 'absolutize_url', array(trim($link->getAttribute('href')), $this->base));
283
-					}
284
-					else
277
+					} else
285 278
 					{
286 279
 						$href = $this->registry->call('Misc', 'absolutize_url', array(trim($link->getAttribute('href')), $this->http_base));
287 280
 					}
@@ -295,8 +288,7 @@  discard block
 block discarded – undo
295 288
 					if ($parsed['authority'] === '' || $parsed['authority'] === $current['authority'])
296 289
 					{
297 290
 						$this->local[] = $href;
298
-					}
299
-					else
291
+					} else
300 292
 					{
301 293
 						$this->elsewhere[] = $href;
302 294
 					}
@@ -331,8 +323,7 @@  discard block
 block discarded – undo
331 323
 				if ($feed->success && ($feed->method & SIMPLEPIE_FILE_SOURCE_REMOTE === 0 || ($feed->status_code === 200 || $feed->status_code > 206 && $feed->status_code < 300)) && $this->is_feed($feed))
332 324
 				{
333 325
 					return $feed;
334
-				}
335
-				else
326
+				} else
336 327
 				{
337 328
 					unset($array[$key]);
338 329
 				}
@@ -359,8 +350,7 @@  discard block
 block discarded – undo
359 350
 				if ($feed->success && ($feed->method & SIMPLEPIE_FILE_SOURCE_REMOTE === 0 || ($feed->status_code === 200 || $feed->status_code > 206 && $feed->status_code < 300)) && $this->is_feed($feed))
360 351
 				{
361 352
 					return $feed;
362
-				}
363
-				else
353
+				} else
364 354
 				{
365 355
 					unset($array[$key]);
366 356
 				}
Please login to merge, or discard this patch.
src/wp-includes/SimplePie/Misc.php 3 patches
Doc Comments   +17 added lines, -2 removed lines patch added patch discarded remove patch
@@ -49,6 +49,9 @@  discard block
 block discarded – undo
49 49
  */
50 50
 class SimplePie_Misc
51 51
 {
52
+	/**
53
+	 * @param integer $seconds
54
+	 */
52 55
 	public static function time_hms($seconds)
53 56
 	{
54 57
 		$time = '';
@@ -329,6 +332,11 @@  discard block
 block discarded – undo
329 332
 		}
330 333
 	}
331 334
 
335
+	/**
336
+	 * @param string $data
337
+	 * @param string $input
338
+	 * @param string $output
339
+	 */
332 340
 	protected static function change_encoding_mbstring($data, $input, $output)
333 341
 	{
334 342
 		if ($input === 'windows-949')
@@ -367,6 +375,11 @@  discard block
 block discarded – undo
367 375
 		return false;
368 376
 	}
369 377
 
378
+	/**
379
+	 * @param string $data
380
+	 * @param string $input
381
+	 * @param string $output
382
+	 */
370 383
 	protected static function change_encoding_iconv($data, $input, $output)
371 384
 	{
372 385
 		return @iconv($input, $output, $data);
@@ -1696,6 +1709,9 @@  discard block
 block discarded – undo
1696 1709
 		}
1697 1710
 	}
1698 1711
 
1712
+	/**
1713
+	 * @return string
1714
+	 */
1699 1715
 	public static function get_curl_version()
1700 1716
 	{
1701 1717
 		if (is_array($curl = curl_version()))
@@ -1763,7 +1779,6 @@  discard block
 block discarded – undo
1763 1779
 	/**
1764 1780
 	 * Remove RFC822 comments
1765 1781
 	 *
1766
-	 * @param string $data Data to strip comments from
1767 1782
 	 * @return string Comment stripped string
1768 1783
 	 */
1769 1784
 	public static function uncomment_rfc822($string)
@@ -2019,7 +2034,7 @@  discard block
 block discarded – undo
2019 2034
 	 * @todo Add support for EBCDIC
2020 2035
 	 * @param string $data XML data
2021 2036
 	 * @param SimplePie_Registry $registry Class registry
2022
-	 * @return array Possible encodings
2037
+	 * @return string[] Possible encodings
2023 2038
 	 */
2024 2039
 	public static function xml_encoding($data, $registry)
2025 2040
 	{
Please login to merge, or discard this patch.
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -64,11 +64,11 @@  discard block
 block discarded – undo
64 64
 		$seconds = $remainder % 60;
65 65
 		if ($minutes < 10 && $hours > 0)
66 66
 		{
67
-			$minutes = '0' . $minutes;
67
+			$minutes = '0'.$minutes;
68 68
 		}
69 69
 		if ($seconds < 10)
70 70
 		{
71
-			$seconds = '0' . $seconds;
71
+			$seconds = '0'.$seconds;
72 72
 		}
73 73
 
74 74
 		$time .= $minutes.':';
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
 	{
100 100
 		$return = array();
101 101
 		$name = preg_quote($realname, '/');
102
-		if (preg_match_all("/<($name)" . SIMPLEPIE_PCRE_HTML_ATTRIBUTE . "(>(.*)<\/$name>|(\/)?>)/siU", $string, $matches, PREG_SET_ORDER | PREG_OFFSET_CAPTURE))
102
+		if (preg_match_all("/<($name)".SIMPLEPIE_PCRE_HTML_ATTRIBUTE."(>(.*)<\/$name>|(\/)?>)/siU", $string, $matches, PREG_SET_ORDER | PREG_OFFSET_CAPTURE))
103 103
 		{
104 104
 			for ($i = 0, $total_matches = count($matches); $i < $total_matches; $i++)
105 105
 			{
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
 					$return[$i]['content'] = $matches[$i][4][0];
117 117
 				}
118 118
 				$return[$i]['attribs'] = array();
119
-				if (isset($matches[$i][2][0]) && preg_match_all('/[\x09\x0A\x0B\x0C\x0D\x20]+([^\x09\x0A\x0B\x0C\x0D\x20\x2F\x3E][^\x09\x0A\x0B\x0C\x0D\x20\x2F\x3D\x3E]*)(?:[\x09\x0A\x0B\x0C\x0D\x20]*=[\x09\x0A\x0B\x0C\x0D\x20]*(?:"([^"]*)"|\'([^\']*)\'|([^\x09\x0A\x0B\x0C\x0D\x20\x22\x27\x3E][^\x09\x0A\x0B\x0C\x0D\x20\x3E]*)?))?/', ' ' . $matches[$i][2][0] . ' ', $attribs, PREG_SET_ORDER))
119
+				if (isset($matches[$i][2][0]) && preg_match_all('/[\x09\x0A\x0B\x0C\x0D\x20]+([^\x09\x0A\x0B\x0C\x0D\x20\x2F\x3E][^\x09\x0A\x0B\x0C\x0D\x20\x2F\x3D\x3E]*)(?:[\x09\x0A\x0B\x0C\x0D\x20]*=[\x09\x0A\x0B\x0C\x0D\x20]*(?:"([^"]*)"|\'([^\']*)\'|([^\x09\x0A\x0B\x0C\x0D\x20\x22\x27\x3E][^\x09\x0A\x0B\x0C\x0D\x20\x3E]*)?))?/', ' '.$matches[$i][2][0].' ', $attribs, PREG_SET_ORDER))
120 120
 				{
121 121
 					for ($j = 0, $total_attribs = count($attribs); $j < $total_attribs; $j++)
122 122
 					{
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
 		foreach ($element['attribs'] as $key => $value)
139 139
 		{
140 140
 			$key = strtolower($key);
141
-			$full .= " $key=\"" . htmlspecialchars($value['data']) . '"';
141
+			$full .= " $key=\"".htmlspecialchars($value['data']).'"';
142 142
 		}
143 143
 		if ($element['self_closing'])
144 144
 		{
@@ -172,13 +172,13 @@  discard block
 block discarded – undo
172 172
 			}
173 173
 
174 174
 			$log_error = true;
175
-			if (!function_exists('error_log'))
175
+			if ( ! function_exists('error_log'))
176 176
 			{
177 177
 				$log_error = false;
178 178
 			}
179 179
 
180 180
 			$log_file = @ini_get('error_log');
181
-			if (!empty($log_file) && ('syslog' !== $log_file) && !@is_writable($log_file))
181
+			if ( ! empty($log_file) && ('syslog' !== $log_file) && ! @is_writable($log_file))
182 182
 			{
183 183
 				$log_error = false;
184 184
 			}
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
 			return SimplePie_Misc::fix_protocol(SimplePie_Misc::compress_parse_url('http', $parsed['authority'], $parsed['path'], $parsed['query'], $parsed['fragment']), $http);
202 202
 		}
203 203
 
204
-		if ($parsed['scheme'] === '' && $parsed['authority'] === '' && !file_exists($url))
204
+		if ($parsed['scheme'] === '' && $parsed['authority'] === '' && ! file_exists($url))
205 205
 		{
206 206
 			return SimplePie_Misc::fix_protocol(SimplePie_Misc::compress_parse_url('http', $parsed['path'], '', $parsed['query'], $parsed['fragment']), $http);
207 207
 		}
@@ -297,7 +297,7 @@  discard block
 block discarded – undo
297 297
 		if ($input === 'US-ASCII')
298 298
 		{
299 299
 			static $non_ascii_octects = '';
300
-			if (!$non_ascii_octects)
300
+			if ( ! $non_ascii_octects)
301 301
 			{
302 302
 				for ($i = 0x80; $i <= 0xFF; $i++)
303 303
 				{
@@ -353,7 +353,7 @@  discard block
 block discarded – undo
353 353
 		{
354 354
 			return false;
355 355
 		}
356
-		if (!in_array($input, mb_list_encodings()))
356
+		if ( ! in_array($input, mb_list_encodings()))
357 357
 		{
358 358
 			return false;
359 359
 		}
@@ -1738,7 +1738,7 @@  discard block
 block discarded – undo
1738 1738
 				$data = '';
1739 1739
 			}
1740 1740
 		}
1741
-		return $output . $data;
1741
+		return $output.$data;
1742 1742
 	}
1743 1743
 
1744 1744
 	public static function parse_date($dt)
@@ -1965,15 +1965,15 @@  discard block
 block discarded – undo
1965 1965
 		}
1966 1966
 		else if ($codepoint <= 0x7ff)
1967 1967
 		{
1968
-			return chr(0xc0 | ($codepoint >> 6)) . chr(0x80 | ($codepoint & 0x3f));
1968
+			return chr(0xc0 | ($codepoint >> 6)).chr(0x80 | ($codepoint & 0x3f));
1969 1969
 		}
1970 1970
 		else if ($codepoint <= 0xffff)
1971 1971
 		{
1972
-			return chr(0xe0 | ($codepoint >> 12)) . chr(0x80 | (($codepoint >> 6) & 0x3f)) . chr(0x80 | ($codepoint & 0x3f));
1972
+			return chr(0xe0 | ($codepoint >> 12)).chr(0x80 | (($codepoint >> 6) & 0x3f)).chr(0x80 | ($codepoint & 0x3f));
1973 1973
 		}
1974 1974
 		else if ($codepoint <= 0x10ffff)
1975 1975
 		{
1976
-			return chr(0xf0 | ($codepoint >> 18)) . chr(0x80 | (($codepoint >> 12) & 0x3f)) . chr(0x80 | (($codepoint >> 6) & 0x3f)) . chr(0x80 | ($codepoint & 0x3f));
1976
+			return chr(0xf0 | ($codepoint >> 18)).chr(0x80 | (($codepoint >> 12) & 0x3f)).chr(0x80 | (($codepoint >> 6) & 0x3f)).chr(0x80 | ($codepoint & 0x3f));
1977 1977
 		}
1978 1978
 		else
1979 1979
 		{
@@ -2129,7 +2129,7 @@  discard block
 block discarded – undo
2129 2129
 		}
2130 2130
 		header('Content-type: text/javascript; charset: UTF-8');
2131 2131
 		header('Cache-Control: must-revalidate');
2132
-		header('Expires: ' . gmdate('D, d M Y H:i:s', time() + 604800) . ' GMT'); // 7 days
2132
+		header('Expires: '.gmdate('D, d M Y H:i:s', time() + 604800).' GMT'); // 7 days
2133 2133
 		?>
2134 2134
 function embed_quicktime(type, bgcolor, width, height, link, placeholder, loop) {
2135 2135
 	if (placeholder != '') {
@@ -2163,14 +2163,14 @@  discard block
 block discarded – undo
2163 2163
 	public static function get_build()
2164 2164
 	{
2165 2165
 		$root = dirname(dirname(__FILE__));
2166
-		if (file_exists($root . '/.git/index'))
2166
+		if (file_exists($root.'/.git/index'))
2167 2167
 		{
2168
-			return filemtime($root . '/.git/index');
2168
+			return filemtime($root.'/.git/index');
2169 2169
 		}
2170
-		elseif (file_exists($root . '/SimplePie'))
2170
+		elseif (file_exists($root.'/SimplePie'))
2171 2171
 		{
2172 2172
 			$time = 0;
2173
-			foreach (glob($root . '/SimplePie/*.php') as $file)
2173
+			foreach (glob($root.'/SimplePie/*.php') as $file)
2174 2174
 			{
2175 2175
 				if (($mtime = filemtime($file)) > $time)
2176 2176
 				{
@@ -2179,9 +2179,9 @@  discard block
 block discarded – undo
2179 2179
 			}
2180 2180
 			return $time;
2181 2181
 		}
2182
-		elseif (file_exists(dirname(__FILE__) . '/Core.php'))
2182
+		elseif (file_exists(dirname(__FILE__).'/Core.php'))
2183 2183
 		{
2184
-			return filemtime(dirname(__FILE__) . '/Core.php');
2184
+			return filemtime(dirname(__FILE__).'/Core.php');
2185 2185
 		}
2186 2186
 		else
2187 2187
 		{
@@ -2194,11 +2194,11 @@  discard block
 block discarded – undo
2194 2194
 	 */
2195 2195
 	public static function debug(&$sp)
2196 2196
 	{
2197
-		$info = 'SimplePie ' . SIMPLEPIE_VERSION . ' Build ' . SIMPLEPIE_BUILD . "\n";
2198
-		$info .= 'PHP ' . PHP_VERSION . "\n";
2197
+		$info = 'SimplePie '.SIMPLEPIE_VERSION.' Build '.SIMPLEPIE_BUILD."\n";
2198
+		$info .= 'PHP '.PHP_VERSION."\n";
2199 2199
 		if ($sp->error() !== null)
2200 2200
 		{
2201
-			$info .= 'Error occurred: ' . $sp->error() . "\n";
2201
+			$info .= 'Error occurred: '.$sp->error()."\n";
2202 2202
 		}
2203 2203
 		else
2204 2204
 		{
@@ -2214,20 +2214,20 @@  discard block
 block discarded – undo
2214 2214
 				switch ($ext)
2215 2215
 				{
2216 2216
 					case 'pcre':
2217
-						$info .= '      Version ' . PCRE_VERSION . "\n";
2217
+						$info .= '      Version '.PCRE_VERSION."\n";
2218 2218
 						break;
2219 2219
 					case 'curl':
2220 2220
 						$version = curl_version();
2221
-						$info .= '      Version ' . $version['version'] . "\n";
2221
+						$info .= '      Version '.$version['version']."\n";
2222 2222
 						break;
2223 2223
 					case 'mbstring':
2224
-						$info .= '      Overloading: ' . mb_get_info('func_overload') . "\n";
2224
+						$info .= '      Overloading: '.mb_get_info('func_overload')."\n";
2225 2225
 						break;
2226 2226
 					case 'iconv':
2227
-						$info .= '      Version ' . ICONV_VERSION . "\n";
2227
+						$info .= '      Version '.ICONV_VERSION."\n";
2228 2228
 						break;
2229 2229
 					case 'xml':
2230
-						$info .= '      Version ' . LIBXML_DOTTED_VERSION . "\n";
2230
+						$info .= '      Version '.LIBXML_DOTTED_VERSION."\n";
2231 2231
 						break;
2232 2232
 				}
2233 2233
 			}
Please login to merge, or discard this patch.
Braces   +29 added lines, -58 removed lines patch added patch discarded remove patch
@@ -109,8 +109,7 @@  discard block
 block discarded – undo
109 109
 				if (strlen($matches[$i][3][0]) <= 2)
110 110
 				{
111 111
 					$return[$i]['self_closing'] = true;
112
-				}
113
-				else
112
+				} else
114 113
 				{
115 114
 					$return[$i]['self_closing'] = false;
116 115
 					$return[$i]['content'] = $matches[$i][4][0];
@@ -143,8 +142,7 @@  discard block
 block discarded – undo
143 142
 		if ($element['self_closing'])
144 143
 		{
145 144
 			$full .= ' />';
146
-		}
147
-		else
145
+		} else
148 146
 		{
149 147
 			$full .= ">$element[content]</$element[tag]>";
150 148
 		}
@@ -209,16 +207,13 @@  discard block
 block discarded – undo
209 207
 		if ($http === 2 && $parsed['scheme'] !== '')
210 208
 		{
211 209
 			return "feed:$url";
212
-		}
213
-		elseif ($http === 3 && strtolower($parsed['scheme']) === 'http')
210
+		} elseif ($http === 3 && strtolower($parsed['scheme']) === 'http')
214 211
 		{
215 212
 			return substr_replace($url, 'podcast', 0, 4);
216
-		}
217
-		elseif ($http === 4 && strtolower($parsed['scheme']) === 'http')
213
+		} elseif ($http === 4 && strtolower($parsed['scheme']) === 'http')
218 214
 		{
219 215
 			return substr_replace($url, 'itpc', 0, 4);
220
-		}
221
-		else
216
+		} else
222 217
 		{
223 218
 			return $url;
224 219
 		}
@@ -259,8 +254,7 @@  discard block
 block discarded – undo
259 254
 		if ($integer >= 0x41 && $integer <= 0x5A || $integer >= 0x61 && $integer <= 0x7A || $integer >= 0x30 && $integer <= 0x39 || $integer === 0x2D || $integer === 0x2E || $integer === 0x5F || $integer === 0x7E)
260 255
 		{
261 256
 			return chr($integer);
262
-		}
263
-		else
257
+		} else
264 258
 		{
265 259
 			return strtoupper($match[0]);
266 260
 		}
@@ -1701,16 +1695,13 @@  discard block
 block discarded – undo
1701 1695
 		if (is_array($curl = curl_version()))
1702 1696
 		{
1703 1697
 			$curl = $curl['version'];
1704
-		}
1705
-		elseif (substr($curl, 0, 5) === 'curl/')
1698
+		} elseif (substr($curl, 0, 5) === 'curl/')
1706 1699
 		{
1707 1700
 			$curl = substr($curl, 5, strcspn($curl, "\x09\x0A\x0B\x0C\x0D", 5));
1708
-		}
1709
-		elseif (substr($curl, 0, 8) === 'libcurl/')
1701
+		} elseif (substr($curl, 0, 8) === 'libcurl/')
1710 1702
 		{
1711 1703
 			$curl = substr($curl, 8, strcspn($curl, "\x09\x0A\x0B\x0C\x0D", 8));
1712
-		}
1713
-		else
1704
+		} else
1714 1705
 		{
1715 1706
 			$curl = 0;
1716 1707
 		}
@@ -1732,8 +1723,7 @@  discard block
 block discarded – undo
1732 1723
 			if (($end = strpos($data, '-->', $start)) !== false)
1733 1724
 			{
1734 1725
 				$data = substr_replace($data, '', 0, $end + 3);
1735
-			}
1736
-			else
1726
+			} else
1737 1727
 			{
1738 1728
 				$data = '';
1739 1729
 			}
@@ -1789,8 +1779,7 @@  discard block
 block discarded – undo
1789 1779
 					{
1790 1780
 						$position++;
1791 1781
 						continue;
1792
-					}
1793
-					elseif (isset($string[$position]))
1782
+					} elseif (isset($string[$position]))
1794 1783
 					{
1795 1784
 						switch ($string[$position])
1796 1785
 						{
@@ -1803,14 +1792,12 @@  discard block
 block discarded – undo
1803 1792
 								break;
1804 1793
 						}
1805 1794
 						$position++;
1806
-					}
1807
-					else
1795
+					} else
1808 1796
 					{
1809 1797
 						break;
1810 1798
 					}
1811 1799
 				}
1812
-			}
1813
-			else
1800
+			} else
1814 1801
 			{
1815 1802
 				$output .= '(';
1816 1803
 			}
@@ -1825,8 +1812,7 @@  discard block
 block discarded – undo
1825 1812
 		if (($pos = strpos($mime, ';')) === false)
1826 1813
 		{
1827 1814
 			return trim($mime);
1828
-		}
1829
-		else
1815
+		} else
1830 1816
 		{
1831 1817
 			return trim(substr($mime, 0, $pos));
1832 1818
 		}
@@ -1837,8 +1823,7 @@  discard block
 block discarded – undo
1837 1823
 		if (isset($attribs['']['mode']) && strtolower(trim($attribs['']['mode']) === 'base64'))
1838 1824
 		{
1839 1825
 			$mode = SIMPLEPIE_CONSTRUCT_BASE64;
1840
-		}
1841
-		else
1826
+		} else
1842 1827
 		{
1843 1828
 			$mode = SIMPLEPIE_CONSTRUCT_NONE;
1844 1829
 		}
@@ -1861,8 +1846,7 @@  discard block
 block discarded – undo
1861 1846
 				default:
1862 1847
 					return SIMPLEPIE_CONSTRUCT_NONE | $mode;
1863 1848
 			}
1864
-		}
1865
-		else
1849
+		} else
1866 1850
 		{
1867 1851
 			return SIMPLEPIE_CONSTRUCT_TEXT | $mode;
1868 1852
 		}
@@ -1909,13 +1893,11 @@  discard block
 block discarded – undo
1909 1893
 			if (in_array(substr($type, -4), array('+xml', '/xml')) || substr($type, 0, 5) === 'text/')
1910 1894
 			{
1911 1895
 				return SIMPLEPIE_CONSTRUCT_NONE;
1912
-			}
1913
-			else
1896
+			} else
1914 1897
 			{
1915 1898
 				return SIMPLEPIE_CONSTRUCT_BASE64;
1916 1899
 			}
1917
-		}
1918
-		else
1900
+		} else
1919 1901
 		{
1920 1902
 			return SIMPLEPIE_CONSTRUCT_TEXT;
1921 1903
 		}
@@ -1958,24 +1940,19 @@  discard block
 block discarded – undo
1958 1940
 		if ($codepoint < 0)
1959 1941
 		{
1960 1942
 			return false;
1961
-		}
1962
-		else if ($codepoint <= 0x7f)
1943
+		} else if ($codepoint <= 0x7f)
1963 1944
 		{
1964 1945
 			return chr($codepoint);
1965
-		}
1966
-		else if ($codepoint <= 0x7ff)
1946
+		} else if ($codepoint <= 0x7ff)
1967 1947
 		{
1968 1948
 			return chr(0xc0 | ($codepoint >> 6)) . chr(0x80 | ($codepoint & 0x3f));
1969
-		}
1970
-		else if ($codepoint <= 0xffff)
1949
+		} else if ($codepoint <= 0xffff)
1971 1950
 		{
1972 1951
 			return chr(0xe0 | ($codepoint >> 12)) . chr(0x80 | (($codepoint >> 6) & 0x3f)) . chr(0x80 | ($codepoint & 0x3f));
1973
-		}
1974
-		else if ($codepoint <= 0x10ffff)
1952
+		} else if ($codepoint <= 0x10ffff)
1975 1953
 		{
1976 1954
 			return chr(0xf0 | ($codepoint >> 18)) . chr(0x80 | (($codepoint >> 12) & 0x3f)) . chr(0x80 | (($codepoint >> 6) & 0x3f)) . chr(0x80 | ($codepoint & 0x3f));
1977
-		}
1978
-		else
1955
+		} else
1979 1956
 		{
1980 1957
 			// U+FFFD REPLACEMENT CHARACTER
1981 1958
 			return "\xEF\xBF\xBD";
@@ -2003,8 +1980,7 @@  discard block
 block discarded – undo
2003 1980
 			{
2004 1981
 				list($name, $value) = explode('=', $section, 2);
2005 1982
 				$return[urldecode($name)][] = urldecode($value);
2006
-			}
2007
-			else
1983
+			} else
2008 1984
 			{
2009 1985
 				$return[urldecode($section)][] = null;
2010 1986
 			}
@@ -2166,8 +2142,7 @@  discard block
 block discarded – undo
2166 2142
 		if (file_exists($root . '/.git/index'))
2167 2143
 		{
2168 2144
 			return filemtime($root . '/.git/index');
2169
-		}
2170
-		elseif (file_exists($root . '/SimplePie'))
2145
+		} elseif (file_exists($root . '/SimplePie'))
2171 2146
 		{
2172 2147
 			$time = 0;
2173 2148
 			foreach (glob($root . '/SimplePie/*.php') as $file)
@@ -2178,12 +2153,10 @@  discard block
 block discarded – undo
2178 2153
 				}
2179 2154
 			}
2180 2155
 			return $time;
2181
-		}
2182
-		elseif (file_exists(dirname(__FILE__) . '/Core.php'))
2156
+		} elseif (file_exists(dirname(__FILE__) . '/Core.php'))
2183 2157
 		{
2184 2158
 			return filemtime(dirname(__FILE__) . '/Core.php');
2185
-		}
2186
-		else
2159
+		} else
2187 2160
 		{
2188 2161
 			return filemtime(__FILE__);
2189 2162
 		}
@@ -2199,8 +2172,7 @@  discard block
 block discarded – undo
2199 2172
 		if ($sp->error() !== null)
2200 2173
 		{
2201 2174
 			$info .= 'Error occurred: ' . $sp->error() . "\n";
2202
-		}
2203
-		else
2175
+		} else
2204 2176
 		{
2205 2177
 			$info .= "No error found.\n";
2206 2178
 		}
@@ -2230,8 +2202,7 @@  discard block
 block discarded – undo
2230 2202
 						$info .= '      Version ' . LIBXML_DOTTED_VERSION . "\n";
2231 2203
 						break;
2232 2204
 				}
2233
-			}
2234
-			else
2205
+			} else
2235 2206
 			{
2236 2207
 				$info .= "    $ext not loaded\n";
2237 2208
 			}
Please login to merge, or discard this patch.
src/wp-includes/SimplePie/Net/IPv6.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -190,7 +190,7 @@
 block discarded – undo
190 190
 	 *           0:0:0:0:0:FFFF:129.144.52.38
191 191
 	 *
192 192
 	 * @param string $ip An IPv6 address
193
-	 * @return array [0] contains the IPv6 represented part, and [1] the IPv4 represented part
193
+	 * @return string[] [0] contains the IPv6 represented part, and [1] the IPv4 represented part
194 194
 	 */
195 195
 	private static function split_v6_v4($ip)
196 196
 	{
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -123,7 +123,7 @@
 block discarded – undo
123 123
 			// xxx::xxx
124 124
 			else
125 125
 			{
126
-				$fill = ':' . str_repeat('0:', 6 - $c2 - $c1);
126
+				$fill = ':'.str_repeat('0:', 6 - $c2 - $c1);
127 127
 				$ip = str_replace('::', $fill, $ip);
128 128
 			}
129 129
 		}
Please login to merge, or discard this patch.
Braces   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -86,16 +86,14 @@  discard block
 block discarded – undo
86 86
 			if ($ip1 === '')
87 87
 			{
88 88
 				$c1 = -1;
89
-			}
90
-			else
89
+			} else
91 90
 			{
92 91
 				$c1 = substr_count($ip1, ':');
93 92
 			}
94 93
 			if ($ip2 === '')
95 94
 			{
96 95
 				$c2 = -1;
97
-			}
98
-			else
96
+			} else
99 97
 			{
100 98
 				$c2 = substr_count($ip2, ':');
101 99
 			}
@@ -173,8 +171,7 @@  discard block
 block discarded – undo
173 171
 		if ($ip_parts[1] !== '')
174 172
 		{
175 173
 			return implode(':', $ip_parts);
176
-		}
177
-		else
174
+		} else
178 175
 		{
179 176
 			return $ip_parts[0];
180 177
 		}
@@ -200,8 +197,7 @@  discard block
 block discarded – undo
200 197
 			$ipv6_part = substr($ip, 0, $pos);
201 198
 			$ipv4_part = substr($ip, $pos + 1);
202 199
 			return array($ipv6_part, $ipv4_part);
203
-		}
204
-		else
200
+		} else
205 201
 		{
206 202
 			return array($ip, '');
207 203
 		}
@@ -226,35 +222,39 @@  discard block
 block discarded – undo
226 222
 			foreach ($ipv6 as $ipv6_part)
227 223
 			{
228 224
 				// The section can't be empty
229
-				if ($ipv6_part === '')
230
-					return false;
225
+				if ($ipv6_part === '') {
226
+									return false;
227
+				}
231 228
 
232 229
 				// Nor can it be over four characters
233
-				if (strlen($ipv6_part) > 4)
234
-					return false;
230
+				if (strlen($ipv6_part) > 4) {
231
+									return false;
232
+				}
235 233
 
236 234
 				// Remove leading zeros (this is safe because of the above)
237 235
 				$ipv6_part = ltrim($ipv6_part, '0');
238
-				if ($ipv6_part === '')
239
-					$ipv6_part = '0';
236
+				if ($ipv6_part === '') {
237
+									$ipv6_part = '0';
238
+				}
240 239
 
241 240
 				// Check the value is valid
242 241
 				$value = hexdec($ipv6_part);
243
-				if (dechex($value) !== strtolower($ipv6_part) || $value < 0 || $value > 0xFFFF)
244
-					return false;
242
+				if (dechex($value) !== strtolower($ipv6_part) || $value < 0 || $value > 0xFFFF) {
243
+									return false;
244
+				}
245 245
 			}
246 246
 			if (count($ipv4) === 4)
247 247
 			{
248 248
 				foreach ($ipv4 as $ipv4_part)
249 249
 				{
250 250
 					$value = (int) $ipv4_part;
251
-					if ((string) $value !== $ipv4_part || $value < 0 || $value > 0xFF)
252
-						return false;
251
+					if ((string) $value !== $ipv4_part || $value < 0 || $value > 0xFF) {
252
+											return false;
253
+					}
253 254
 				}
254 255
 			}
255 256
 			return true;
256
-		}
257
-		else
257
+		} else
258 258
 		{
259 259
 			return false;
260 260
 		}
Please login to merge, or discard this patch.