Index: podpress_admin_class.php
===================================================================
--- podpress_admin_class.php	(Revision 192285)
+++ podpress_admin_class.php	(Arbeitskopie)
@@ -344,7 +344,7 @@
 				echo '						</td>'."\n";
 				echo '						<td>'."\n";
 				echo '							<input type="text" id="podPressMedia_'.$num.'_dimensionW" name="podPressMedia['.$num.'][dimensionW]" size="5" value="'.$thisMedia['dimensionW'].'" onchange="javascript: podPressMediaFiles['.$num.'][\'dimensionW\'] = this.value;" />x<input type="text" id="podPressMedia_'.$num.'_dimensionH" name="podPressMedia['.$num.'][dimensionH]" size="5" value="'.$thisMedia['dimensionH'].'" onchange="javascript: podPressMediaFiles['.$num.'][\'dimensionH\'] = this.value;" /> '."\n";
-				echo '							<select onchange="javascript: podPressUpdateDimensions(\''.$num.'\', this.value);">'."\n"; podPress_videoDimensionOptions();	echo '</select>'."\n";
+				echo '							<select onchange="javascript: podPressUpdateDimensions(\''.$num.'\', this.value);">'."\n"; podPress_videoDimensionOptions($thisMedia['dimensionW'].':'.$thisMedia['dimensionH']);	echo '</select>'."\n";
 				echo '						</td>'."\n";
 				echo '					</tr>'."\n";
 
@@ -881,7 +881,7 @@
 				echo '						<td>'."\n";
 				echo '							<div id="podPressPlayerSpace_'.$num.'"></div>'."\n";
 				echo '<script type="text/javascript"><!--'."\n";
-				echo "	document.getElementById('podPressPlayerSpace_".$num."').innerHTML = podPressGenerateVideoPreview (".$num.", '', '', '', document.getElementById('podPressMedia_".$num."_previewImage').value, true);\n";
+				echo "	document.getElementById('podPressPlayerSpace_".$num."').innerHTML = podPressGenerateVideoPreview (".$num.", '', '', '', document.getElementById('podPressMedia_".$num."_previewImage').value, true, true);\n";
 				echo "--></script>\n";
 				echo '						</td>'."\n";
 				echo '					</tr>'."\n";
@@ -892,7 +892,7 @@
 				echo '						</td>'."\n";
 				echo '						<td>'."\n";
 				echo '							<input type="text" id="podPressMedia_'.$num.'_dimensionW" name="podPressMedia['.$num.'][dimensionW]" size="5" value="'.$thisMedia['dimensionW'].'" onchange="javascript: podPressMediaFiles['.$num.'][\'dimensionW\'] = this.value;" />x<input type="text" id="podPressMedia_'.$num.'_dimensionH" name="podPressMedia['.$num.'][dimensionH]" size="5" value="'.$thisMedia['dimensionH'].'" onchange="javascript: podPressMediaFiles['.$num.'][\'dimensionH\'] = this.value;" /> '."\n";
-				echo '							<select onchange="javascript: podPressUpdateDimensions(\''.$num.'\', this.value);">'."\n"; podPress_videoDimensionOptions();	echo '</select>'."\n";
+				echo '							<select onchange="javascript: podPressUpdateDimensions(\''.$num.'\', this.value);">'."\n"; podPress_videoDimensionOptions($thisMedia['dimensionW'].':'.$thisMedia['dimensionH']);	echo '</select>'."\n";
 				echo '						</td>'."\n";
 				echo '					</tr>'."\n";
 
@@ -1276,7 +1276,7 @@
 			echo '		<fieldset class="options">'."\n";
 			echo '			<legend>'.__('Podcast Feed Options', 'podpress').'</legend>'."\n";
 
-			echo '		<table width="110%" cellspacing="2" cellpadding="5" class="editform" >'."\n";
+			echo '		<table width="110%" cellspacing="2" cellpadding="5" class="editform" id="podpress_feed_options_table">'."\n";
 			echo '			<tr>'."\n";
 			echo '				<td width="50%"><h3>'.__('iTunes Settings', 'podpress').'</h3></td>'."\n";
 			echo '				<td width="50%"><h3>'.__('Standard Settings', 'podpress').'</h3></td>'."\n";
@@ -1364,8 +1364,10 @@
 
 			echo '			<tr valign="top">'."\n";
 			echo '				<td width="50%">';
-			echo '					<label for="iTunesImageChoice"><strong>'.__('iTunes:Image', 'podpress').' (300*300 pixels)</strong></label>'."\n";
+			echo '					<label for="iTunesImageChoice"><strong>'.__('iTunes:Image', 'podpress').'</strong></label>'."\n";
 			echo '					<br/>';
+			echo '					'.__('The iTunes image should be a square image with <a href="http://www.apple.com/itunes/podcasts/specs.html#image" target="_blank">at least 600 x 600 pixels</a> as Apple writes (01/2010) in "<a href="http://www.apple.com/itunes/podcasts/specs.html" target="_blank">Making a Podcast</a>" of their own Podcasting Resources. In the past 300 x 300 pixels were recommended. iTunes supports JPEG and PNG images (the file name extensions should ".jpg" or ".png").', 'podpress')."\n";
+			echo '					<br/>';
 			echo '					<select id="iTunesImageChoice" name="iTunesImageChoice" onchange="javascript: podPress_updateCategoryCasting();">'."\n";
 			echo '						<option value="Global" '; if($data['iTunesImageChoice'] != 'Custom') { echo 'selected="selected"';	}	echo '>'.__('Use Global', 'podpress').'</option>'."\n";
 			echo '						<option value="Custom" '; if($data['iTunesImageChoice'] == 'Custom') { echo 'selected="selected"';	}	echo '>'.__('Custom', 'podpress').'</option>'."\n";
@@ -1376,10 +1378,11 @@
 			echo '						<input id="global_iTunesImage" type="hidden" value="'.$this->settings['iTunes']['image'].'"/>'."\n";
 			echo '					</div>'."\n";
 			echo '					<br/>';
-			echo '					<img id="itunes_image_display" width="300" height="300" alt="Podcast Image - Big" src="" />'."\n";
+			echo '					<img id="itunes_image_display" style="width:300px; height:300px;" alt="Podcast Image - Big" src="" /><br />'."\n";
+			echo '					<em>'.__('(This image is only a preview which is limited to 300 x 300 pixels.) ', 'podpress').'</em>';
 			echo '				</td>'."\n";
 			echo '				<td width="50%">';
-			echo '					<label for="rss_imageChoice"><strong>'.__('Blog/RSS Image', 'podpress').' (144*144 pixels)</strong></label>'."\n";
+			echo '					<label for="rss_imageChoice"><strong>'.__('Blog/RSS Image (144 x 144 pixels)', 'podpress').'</strong></label>'."\n";
 			echo '					<br/>';
 			echo '					<select id="rss_imageChoice" name="rss_imageChoice" onchange="javascript: podPress_updateCategoryCasting();">'."\n";
 			echo '						<option value="Global" '; if($data['rss_imageChoice'] != 'Custom') { echo 'selected="selected"';	}	echo '>'.__('Use Global', 'podpress').'</option>'."\n";
@@ -1391,7 +1394,7 @@
 			echo '						<input id="global_rss_image" type="hidden" value="'.get_option('rss_image').'"/>'."\n";
 			echo '					</div>'."\n";
 			echo '					<br/>';
-			echo '					<img id="rss_image_Display" width="144" height="144" alt="Podcast Image - Small" src="" />'."\n";
+			echo '					<img id="rss_image_Display" style="width:144px; height:144px;" alt="Podcast Image - Small" src="" />'."\n";
 			echo '				</td>'."\n";
 			echo '			</tr>'."\n";
 
@@ -1448,8 +1451,10 @@
 			echo '					<label for="rss_language"><strong>'.__('Language', 'podpress').'</strong></label>:'."\n";
 			echo '					<br/>';
 			echo '					<select id="rss_language" name="rss_language" onchange="javascript: podPress_updateCategoryCasting();">'."\n";
+			echo '						<optgroup label="'.__('Select Language', 'podpress').'">'."\n";
 			echo '						<option value="##Global##" '; if($data['rss_language'] == '##Global##' || empty($data['rss_language'])) { echo 'selected="selected"';	}	echo '>'.__('Use Global', 'podpress').' - '.$langs[get_option('rss_language')].' ['.get_option('rss_language').']</option>'."\n";
 			podPress_itunesLanguageOptions($data['rss_language']);
+			echo '						</optgroup>'."\n";
 			echo '					</select>'."\n";
 			echo '					<input type="hidden" id="global_rss_language" value="'.$langs[get_option('rss_language')].'['.stripslashes(get_option('rss_language')).']" /></td>'."\n";
 			echo '				</td>'."\n";
@@ -1477,17 +1482,35 @@
 			echo '					<label for="iTunesCategory_0"><strong>'.__('iTunes:Categories', 'podpress').'</strong></label>';
 			echo '					<br/>';
 			echo '					<select id="iTunesCategory_0" name="iTunesCategory[0]" onchange="podPress_updateCategoryCasting();">'."\n";
-			echo '						<option value="##Global##" '; if($data['iTunesCategory'][0] == '##Global##' || empty($data['iTunesCategory'][0])) { echo 'selected="selected"';	}	echo '>'.__('Use Global', 'podpress').' ('.$this->settings['iTunes']['category'][0].')</option>'."\n";
-			podPress_itunesCategoryOptions(htmlentities($data['iTunesCategory'][0]), ENT_QUOTES, $blog_charset);
+			echo '						<optgroup label="'.__('Select Primary', 'podpress').'">'."\n";
+			echo '						<option value="##Global##" '; if($data['iTunesCategory'][0] == '##Global##' || empty($data['iTunesCategory'][0])) { echo 'selected="selected"'; } echo '>'.__('Use Global', 'podpress').' ('.$this->settings['iTunes']['category'][0].')</option>'."\n";
+			if (empty($data['iTunesCategory'][0])) {
+				podPress_itunesCategoryOptions(htmlentities('##Global##'), ENT_QUOTES, $blog_charset);
+			} else {
+				podPress_itunesCategoryOptions(htmlentities($data['iTunesCategory'][0]), ENT_QUOTES, $blog_charset);
+			}
+			echo '						</optgroup>'."\n";
 			echo '					</select><br/>'."\n";
 			echo '					<input type="hidden" id="global_iTunesCategory" value="'.htmlentities(stripslashes($this->settings['iTunes']['category'][0]), ENT_QUOTES, $blog_charset).'" />'."\n";
 			echo '					<select name="iTunesCategory[1]">'."\n";
+			echo '						<optgroup label="'.__('Select Second', 'podpress').'">'."\n";
 			echo '						<option value="##Global##" '; if($data['iTunesCategory'][1] == '##Global##' || empty($data['iTunesCategory'][1])) { echo 'selected="selected"';	}	echo '>'.__('Use Global', 'podpress').' ('.$this->settings['iTunes']['category'][1].')</option>'."\n";
-			podPress_itunesCategoryOptions(htmlentities($data['iTunesCategory'][1]), ENT_QUOTES, $blog_charset);
+			if (empty($data['iTunesCategory'][1])) {
+				podPress_itunesCategoryOptions(htmlentities('##Global##'), ENT_QUOTES, $blog_charset);
+			} else {
+				podPress_itunesCategoryOptions(htmlentities($data['iTunesCategory'][1]), ENT_QUOTES, $blog_charset);
+			}
+			echo '						</optgroup>'."\n";
 			echo '					</select><br/>'."\n";
 			echo '					<select name="iTunesCategory[2]">'."\n";
+			echo '						<optgroup label="'.__('Select Third', 'podpress').'">'."\n";
 			echo '						<option value="##Global##" '; if($data['iTunesCategory'][2] == '##Global##' || empty($data['iTunesCategory'][2])) { echo 'selected="selected"';	}	echo '>'.__('Use Global', 'podpress').' ('.$this->settings['iTunes']['category'][2].')</option>'."\n";
-			podPress_itunesCategoryOptions(htmlentities($data['iTunesCategory'][2]), ENT_QUOTES, $blog_charset);
+			if (empty($data['iTunesCategory'][2])) {
+				podPress_itunesCategoryOptions(htmlentities('##Global##'), ENT_QUOTES, $blog_charset);
+			} else {
+				podPress_itunesCategoryOptions(htmlentities($data['iTunesCategory'][2]), ENT_QUOTES, $blog_charset);
+			}
+			echo '						</optgroup>'."\n";
 			echo '					</select>'."\n";
 			echo '				</td>'."\n";
 			echo '			</tr>'."\n";
Index: podpress_admin_feed_class.php
===================================================================
--- podpress_admin_feed_class.php	(Revision 192285)
+++ podpress_admin_feed_class.php	(Arbeitskopie)
@@ -47,7 +47,7 @@
 			echo '		<input type="submit" name="Submit" value="'.__('Update Options', 'podpress').' &raquo;" /> '."\n";
 			echo '		</p> '."\n";
 			*/
-			echo '		<table width="100%" cellspacing="2" cellpadding="5" class="editform" >'."\n";
+			echo '		<table width="100%" cellspacing="2" cellpadding="5" class="editform" id="podpress_feed_options_table">'."\n";
 			echo '			<tr>'."\n";
 			echo '				<td width="50%"><h3>'.__('iTunes Settings', 'podpress').'</h3></td>'."\n";
 			echo '				<td width="50%"><h3>'.__('Standard Settings', 'podpress').'</h3></td>'."\n";
@@ -125,18 +125,21 @@
 
 			echo '			<tr valign="top">'."\n";
 			echo '				<td width="50%">'."\n";
-			echo '					<label for="iTunesImage"><strong>'.__('iTunes:Image', 'podpress').' (300*300 pixels)</strong></label>'."\n";
+			echo '					<label for="iTunesImage"><strong>'.__('iTunes:Image', 'podpress').'</strong></label>';
 			echo '					<br/>';
+			echo '					'.__('The iTunes image should be a square image with <a href="http://www.apple.com/itunes/podcasts/specs.html#image" target="_blank">at least 600 x 600 pixels</a> as Apple writes (2009) in "<a href="http://www.apple.com/itunes/podcasts/specs.html" target="_blank">Making a Podcast</a>" of their own Podcasting Resources. In the past 300 x 300 pixels were recommended. iTunes supports JPEG and PNG images (the file name extensions should ".jpg" or ".png").', 'podpress')."\n";
+			echo '					<br/>';
 			echo '					<input id="iTunesImage" type="text" name="iTunes[image]" value="'.$this->settings['iTunes']['image'].'" size="40" onchange="podPress_updateFeedSettings();"/>'."\n";
 			echo '					<br />';
-			echo '					<img id="iTunesImagePreview" width="300" height="300" alt="Podcast Image - Big" src="" />'."\n";
+			echo '					<img id="iTunesImagePreview" style="width:300px; height:300px;" alt="Podcast Image - Big" src="" />'."<br />\n";
+			echo '					<em>'.__('(This image is only a preview which is limited to 300 x 300 pixels.) ', 'podpress').'</em>';
 			echo '				</td>'."\n";
 			echo '				<td width="50%">'."\n";
-			echo '					<label for="rss_image"><strong>'.__('Blog/RSS Image', 'podpress').' (144*144 pixels)</strong></label>'."\n";
+			echo '					<label for="rss_image"><strong>'.__('Blog/RSS Image (144 x 144 pixels)', 'podpress').'</strong></label>'."\n";
 			echo '					<br/>';
 			echo '					<input id="rss_image" type="text" name="rss_image" value="'.get_option('rss_image').'" size="40" onchange="podPress_updateFeedSettings();"/>'."\n";
 			echo '					<br />';
-			echo '					<img id="rss_imagePreview" width="144" height="144" alt="Podcast Image - Small" src="" />'."\n";
+			echo '					<img id="rss_imagePreview" style="width:144px; height:144px;" alt="Podcast Image - Small" src="" />'."\n";
 			echo '				</td>'."\n";
 			echo '			</tr>'."\n";
 
@@ -164,10 +167,10 @@
 			echo '					<label for="rss_language"><strong>'.__('Language', 'podpress').'</strong></label>';
 			echo '					<br/>';
 			echo '					<select id="rss_language" name="rss_language" onchange="podPress_updateFeedSettings();">'."\n";
-			echo '						<option value="#">'.__('Select Language', 'podpress').'</option>'."\n";
+			echo '						<optgroup label="'.__('Select Language', 'podpress').'">'."\n";
 			podPress_itunesLanguageOptions(get_option('rss_language'));
+			echo '						</optgroup>'."\n";
 			echo '					</select>'."\n";
-			echo '					<br/>'.__('Used as default Podcast Episode Title', 'podpress').' (255 '.__('characters', 'podpress').')'."\n";
 			echo '				</td>'."\n";
 			echo '			</tr>'."\n";
 
@@ -194,16 +197,19 @@
 			echo '					<label for="iTunesCategory_0"><strong>'.__('iTunes:Categories', 'podpress').'</strong></label>';
 			echo '					<br/>';
 			echo '					<select id="iTunesCategory_0" name="iTunes[category][0]" onchange="podPress_updateFeedSettings();">'."\n";
-			echo '						<option value="#">'.__('Select Primary', 'podpress').'</option>'."\n";
+			echo '						<optgroup label="'.__('Select Primary', 'podpress').'">'."\n";
 			podPress_itunesCategoryOptions(htmlentities($this->settings['iTunes']['category'][0]), ENT_QUOTES, $blog_charset);
+			echo '						</optgroup>'."\n";
 			echo '					</select>'."\n";
 			echo '					<select name="iTunes[category][1]">'."\n";
-			echo '						<option value="#">'.__('Select Second', 'podpress').'</option>'."\n";
+			echo '						<optgroup label="'.__('Select Second', 'podpress').'">'."\n";
 			podPress_itunesCategoryOptions(htmlentities($this->settings['iTunes']['category'][1]), ENT_QUOTES, $blog_charset);
+			echo '						</optgroup>'."\n";
 			echo '					</select>'."\n";
 			echo '					<select name="iTunes[category][2]">'."\n";
-			echo '						<option value="#">'.__('Select Third', 'podpress').'</option>'."\n";
+			echo '						<optgroup label="'.__('Select Third', 'podpress').'">'."\n";
 			podPress_itunesCategoryOptions(htmlentities($this->settings['iTunes']['category'][2]), ENT_QUOTES, $blog_charset);
+			echo '						</optgroup>'."\n";
 			echo '					</select>'."\n";
 			echo '				</td>'."\n";
 			echo '				<td width="50%">'."\n";
@@ -286,7 +292,7 @@
 			echo '						<option value="No" '; if($this->settings['protectFeed'] != 'Yes') { echo 'selected="selected"'; } echo '>'.__('No', 'podpress').'</option>'."\n";
 			echo '						<option value="Yes" '; if($this->settings['protectFeed'] == 'Yes') { echo 'selected="selected"'; } echo '>'.__('Yes', 'podpress').'</option>'."\n";
 			echo '					</select>'."\n";
-			echo '					<br/>'.__('This will strip out any invalid characters, as well as images and links from your post content in the feeds. Only works with UTF-8 feeds.', 'podpress')."\n";
+			echo '					<br/>'.__('"Yes" will convert any invalid characters to their numeric character references in the feeds. "No" will convert only ampersand, less-than, greater-than, apostrophe and quotation signs to their numeric character references.', 'podpress')."\n";
 			echo '				</td>'."\n";
 			echo '			</tr>'."\n";
 
Index: podpress_admin_functions.php
===================================================================
--- podpress_admin_functions.php	(Revision 192285)
+++ podpress_admin_functions.php	(Arbeitskopie)
@@ -359,11 +359,10 @@
 	}
 
 
-	function podPress_videoDimensionOptions() {
+	function podPress_videoDimensionOptions($selected='320:240') {
 		$dimensions = array();
 		reset($dimensions);
 
-		$dimensions['0'] = __('Common Dimensions', 'podpress');
 		$dimensions['160:120'] = '160 x 120';
 		$dimensions['320:240'] = '320 x 240';
 		$dimensions['640:480'] = '640 x 480';
@@ -372,10 +371,16 @@
 		$dimensions['480:260'] = '480 x 260 [16:9 - 1.85:1]';
 		$dimensions['720:405'] = '720 x 405 [16:9 - 1.78:1]';
 		$dimensions['720:390'] = '720 x 390 [16:9 - 1.85:1]';
-
+		echo '<optgroup label="'.__('Common Dimensions', 'podpress').'">'."\n";
 		foreach ($dimensions as $key => $value) {
-			echo '<option value="'.$key.'">'.$value.'</option>'."\n";
+			if ($key == $selected) {
+				$selected_str =' selected="selected"';
+			} else {
+				$selected_str ='';
+			}
+			echo '<option value="'.$key.'"'.$selected_str.'>'.$value.'</option>'."\n";
 		}
+		echo '</optgroup>'."\n";
 	}
 
 	function podPress_itunesLanguageArray() {
@@ -480,7 +485,6 @@
 	}
 
 	function podPress_itunesLanguageOptions($current = 'en-us') {
-
 		$langs = podPress_itunesLanguageArray();
 		reset($langs);
 		foreach ($langs as $key => $value) {
@@ -494,6 +498,10 @@
 
 	function podPress_itunesCategoryOptions($current = '') {
 		$cats = array();
+		if ('' == trim($current) AND '##Global##' != $current) {
+			$current='[ '.__('nothing', 'podpress').' ]';
+		}
+		$cats[] = '[ '.__('nothing', 'podpress').' ]';
 
 		$cats[] = 'Arts';
 		$cats[] = 'Arts:Design';
@@ -590,8 +598,8 @@
 			}
 			echo ' >'.$value.'</option>'."\n";
 		}
-
-		if(!$foundit) {
+		
+		if(!$foundit AND '##Global##' != $current) {
 			$current = podPress_upgradeCategory($current);
 			echo '<option selected="selected">'.$current.'</option>'."\n";
 		}
Index: podpress_admin_wp27plus.css
===================================================================
--- podpress_admin_wp27plus.css	(Revision 192285)
+++ podpress_admin_wp27plus.css	(Arbeitskopie)
@@ -8,3 +8,7 @@
 	line-height:100%;
 	padding-top:0.5em;
 }
+
+#podpress_feed_options_table td {
+padding:15px 0px 0px 0px;
+}
\ No newline at end of file
Index: podpress_feed_functions.php
===================================================================
--- podpress_feed_functions.php	(Revision 192285)
+++ podpress_feed_functions.php	(Arbeitskopie)
@@ -21,17 +21,37 @@
 	/*************************************************************/
 	/* feed generation functions                                 */
 	/*************************************************************/
-
-	function podPress_feedSafeContent($input, $aggressive = false)
-	{
+	
+	function podPress_feedSafeContent($input, $aggressive = false) {
 		GLOBAL $podPress;
-		if ( ('no' == strtolower($podPress->settings['protectFeed']) OR FALSE === $podPress->settings['protectFeed']) AND !$aggressive) {
+		/*
+		// if the feed should not be protect agressively (option in the backend) then return immediately
+		if ( ('no' == strtolower($podPress->settings['protectFeed']) OR FALSE === $podPress->settings['protectFeed']) AND FALSE === $aggressive) {
 			return $input;
 		}
-		$result = htmlentities($input, ENT_NOQUOTES, get_bloginfo('charset'), FALSE);
-		if($aggressive) {
-			$result = str_replace(array('&amp;', '&lt;', '&gt;', '&'), '', $result);
+		*/
+		// replace the relevant characters with their HTML entities
+		if (TRUE === $aggressive OR 'yes' == strtolower($podPress->settings['protectFeed']) OR TRUE === $podPress->settings['protectFeed'] ) { // this option is only reachable via php source code and via the WP backend
+			$result = htmlentities($input, ENT_NOQUOTES, get_bloginfo('charset'), FALSE);
+		} else {
+			$result = htmlspecialchars($input, ENT_NOQUOTES, get_bloginfo('charset'), FALSE);
 		}
+		
+		if (TRUE === $aggressive) { // this option is only reachable via php source code and via the WP backend
+			$input = $result;
+			$result = str_replace(array('&amp;', '&lt;', '&gt;', '&'), '', $input);
+		}
+		$input = $result;
+		
+		// get the HTML translation table
+		$table = get_html_translation_table(HTML_ENTITIES);//HTML_SPECIALCHARS
+		
+		// replace the HTML entities with their numeric entities which are okay for XML
+		foreach ($table as $chr => $htmlentity) {
+			$ord = ord($chr); // get the ASCII number of the character
+			$result = str_replace($htmlentity, '&#'.$ord.';', $input);
+			$input = $result;
+		}
 		return $result;
 	}
 
@@ -54,7 +74,6 @@
 				}
 			}
 		}
-
 		if(!isset($podPress->settings['category_data'])) {
 			podPress_feed_getCategory();
 		}
@@ -129,45 +148,45 @@
 		if(!empty($data['rss_ttl']) && $data['rss_ttl'] < 1440) {
 			$data['rss_ttl'] = 1440;
 		}
-		echo '	<!-- podcast_generator="podPress/'.PODPRESS_VERSION.'" - maintenance_release="'.PODPRESS_MAINTENANCE_VERSION.'" -->'."\n";
+		echo '<!-- podcast_generator="podPress/'.PODPRESS_VERSION.'" - maintenance_release="'.PODPRESS_MAINTENANCE_VERSION.'" -->'."\n";
 		if (empty($data['rss_copyright'])) {
-			echo '		<copyright>'.podPress_feedSafeContent(__('Copyright', 'podpress').' &#xA9; '. date('Y',time())).' '.get_bloginfo('blogname').' '.$podPress->settings['rss_license_url'].'</copyright>'."\n";
+			echo '	<copyright>'.podPress_feedSafeContent(__('Copyright', 'podpress').' &#xA9; '. date('Y',time())).' '.get_bloginfo('blogname').' '.$podPress->settings['rss_license_url'].'</copyright>'."\n";
 		} else {
-			echo '		<copyright>'.podPress_feedSafeContent($data['rss_copyright']).' '.$podPress->settings['rss_license_url'].'</copyright>'."\n";
+			echo '	<copyright>'.podPress_feedSafeContent($data['rss_copyright']).' '.$podPress->settings['rss_license_url'].'</copyright>'."\n";
 		}
 		if($data['new-feed-url'] == 'Enable') {
 			if(!empty($data['podcastFeedURL']) && !strpos(strtolower($data['podcastFeedURL']), 'phobos.apple.com') && !strpos(strtolower($data['podcastFeedURL']), 'itpc://')) {
 				echo '		<itunes:new-feed-url>'.podPress_feedSafeContent($data['podcastFeedURL']).'</itunes:new-feed-url>'."\n";
 			}
 		}
-		echo '		<managingEditor>'.podPress_feedSafeContent(stripslashes(get_option('admin_email'))).' ('.podPress_feedSafeContent($data['author']).')</managingEditor>'."\n";
-		echo '		<webMaster>'.podPress_feedSafeContent(get_option('admin_email')).' ('.podPress_feedSafeContent($data['author']).')</webMaster>'."\n";
-		echo '		<category>'.podPress_feedSafeContent($rss_category).'</category>'."\n";
+		echo '	<managingEditor>'.podPress_feedSafeContent(stripslashes(get_option('admin_email'))).' ('.podPress_feedSafeContent($data['author']).')</managingEditor>'."\n";
+		echo '	<webMaster>'.podPress_feedSafeContent(get_option('admin_email')).' ('.podPress_feedSafeContent($data['author']).')</webMaster>'."\n";
+		echo '	<category>'.podPress_feedSafeContent($rss_category).'</category>'."\n";
 		if(!empty($data['rss_ttl'])) {
-			echo '		<ttl>'.$data['rss_ttl'].'</ttl>'."\n";
+			echo '	<ttl>'.$data['rss_ttl'].'</ttl>'."\n";
 		}
-		echo '		<itunes:keywords>'.podPress_stringLimiter(podPress_feedSafeContent($data['keywords'], true), 255).'</itunes:keywords>'."\n";
-		echo '		<itunes:subtitle>'.podPress_stringLimiter(podPress_feedSafeContent($data['subtitle'], true), 255).'</itunes:subtitle>'."\n";
-		echo '		<itunes:summary>'.podPress_stringLimiter(podPress_feedSafeContent($data['summary'], true), 4000).'</itunes:summary>'."\n";
-		echo '		<itunes:author>'.podPress_feedSafeContent($data['author']).'</itunes:author>'."\n";
-		echo '		' .podPress_getiTunesCategoryTags();
-		echo '		<itunes:owner>'."\n";
-		echo '			<itunes:name>'.stripslashes(podPress_feedSafeContent($data['author'])).'</itunes:name>'."\n";
-		echo '			<itunes:email>'.podPress_feedSafeContent($data['admin_email']).'</itunes:email>'."\n";
-		echo '		</itunes:owner>'."\n";
+		echo '	<itunes:keywords>'.podPress_stringLimiter(podPress_feedSafeContent($data['keywords']), 255).'</itunes:keywords>'."\n";
+		echo '	<itunes:subtitle>'.podPress_stringLimiter(podPress_feedSafeContent($data['subtitle']), 255).'</itunes:subtitle>'."\n";
+		echo '	<itunes:summary>'.podPress_stringLimiter(podPress_feedSafeContent($data['summary']), 4000).'</itunes:summary>'."\n";
+		echo '	<itunes:author>'.podPress_feedSafeContent($data['author']).'</itunes:author>'."\n";
+		echo podPress_getiTunesCategoryTags();
+		echo '	<itunes:owner>'."\n";
+		echo '		<itunes:name>'.stripslashes(podPress_feedSafeContent($data['author'])).'</itunes:name>'."\n";
+		echo '		<itunes:email>'.podPress_feedSafeContent($data['admin_email']).'</itunes:email>'."\n";
+		echo '	</itunes:owner>'."\n";
 		if(empty($data['block'])) {
 			$data['block'] = 'No';
 		}
-		echo '		<itunes:block>'.$data['block'].'</itunes:block>'."\n";
-		echo '		<itunes:explicit>'.podPress_feedSafeContent(strtolower($data['explicit'])).'</itunes:explicit>'."\n";
-		echo '		<itunes:image href="'.$data['image'].'" />'."\n";
-		echo '		<image>'."\n";
-		echo '			<url>'.podPress_feedSafeContent($data['rss_image']).'</url>'."\n";
-		echo '			<title>'; bloginfo_rss('name'); echo '</title>'."\n";
-		echo '			<link>'; bloginfo_rss('url'); echo '</link>'."\n";
-		echo '			<width>144</width>'."\n";
-		echo '			<height>144</height>'."\n";
-		echo '		</image>'."\n";
+		echo '	<itunes:block>'.$data['block'].'</itunes:block>'."\n";
+		echo '	<itunes:explicit>'.podPress_feedSafeContent(strtolower($data['explicit'])).'</itunes:explicit>'."\n";
+		echo '	<itunes:image href="'.$data['image'].'" />'."\n";
+		echo '	<image>'."\n";
+		echo '		<url>'.$data['rss_image'].'</url>'."\n";
+		echo '		<title>'.podPress_feedSafeContent(get_bloginfo('blogname')).'</title>'."\n";
+		echo '		<link>'.get_bloginfo('siteurl').'</link>'."\n";
+		echo '		<width>144</width>'."\n";
+		echo '		<height>144</height>'."\n";
+		echo '	</image>'."\n";
 	}
 
 	function podPress_rss2_item() {
@@ -175,7 +194,7 @@
 		$enclosureTag = podPress_getEnclosureTags();
 		if($enclosureTag != '') // if no enclosure tag, no need for iTunes tags
 		{
-			echo "\t" . $enclosureTag;
+			echo $enclosureTag;
 
 			if($post->podPressPostSpecific['itunes:subtitle'] == '##PostExcerpt##') {
 				ob_start();
@@ -187,7 +206,7 @@
 			if(empty($post->podPressPostSpecific['itunes:subtitle'])) {
 				$post->podPressPostSpecific['itunes:subtitle'] = get_the_title_rss();
 			}
-			echo '		<itunes:subtitle>'.podPress_feedSafeContent($post->podPressPostSpecific['itunes:subtitle'], true).'</itunes:subtitle>'."\n";
+			echo '		<itunes:subtitle>'.podPress_feedSafeContent($post->podPressPostSpecific['itunes:subtitle']).'</itunes:subtitle>'."\n";
 
 			if($post->podPressPostSpecific['itunes:summary'] == '##Global##') {
 				$post->podPressPostSpecific['itunes:summary'] = $podPress->settings['iTunes']['summary'];
@@ -202,25 +221,21 @@
 			if(empty($post->podPressPostSpecific['itunes:summary'])) {
 				$post->podPressPostSpecific['itunes:summary'] = $podPress->settings['iTunes']['summary'];
 			}
-			echo '		<itunes:summary>'.podPress_stringLimiter(podPress_feedSafeContent($post->podPressPostSpecific['itunes:summary'], true), 4000).'</itunes:summary>'."\n";
+			echo '		<itunes:summary>'.podPress_stringLimiter(podPress_feedSafeContent($post->podPressPostSpecific['itunes:summary']), 4000).'</itunes:summary>'."\n";
 
 			if($post->podPressPostSpecific['itunes:keywords'] == '##WordPressCats##') {
 				$categories = get_the_category();
 				$post->podPressPostSpecific['itunes:keywords'] = '';
 				if(is_array($categories)) {
 					foreach ($categories as $category) {
-						$category->cat_name = $category->cat_name;
-						if($post->podPressPostSpecific['itunes:keywords'] != '') {
-							$post->podPressPostSpecific['itunes:keywords'] .= ', ';
-						}
-						$post->podPressPostSpecific['itunes:keywords'] .= $category->cat_name;
+						$category_names[] = $category->cat_name;
 					}
-					$post->podPressPostSpecific['itunes:keywords'] = trim($post->podPressPostSpecific['itunes:keywords']);
+					$post->podPressPostSpecific['itunes:keywords'] = implode(', ', $category_names);
 				}
-			} elseif($post->podPressPostSpecific['itunes:keywords'] == '##Global##') {
+			} elseif ($post->podPressPostSpecific['itunes:keywords'] == '##Global##') {
 				$post->podPressPostSpecific['itunes:keywords'] = $podPress->settings['iTunes']['keywords'];
 			}
-			echo '		<itunes:keywords>'.podPress_stringLimiter(podPress_feedSafeContent(str_replace(' ', ',', $post->podPressPostSpecific['itunes:keywords']), true), 255).'</itunes:keywords>'."\n";
+			echo '		<itunes:keywords>'.podPress_stringLimiter(podPress_feedSafeContent($post->podPressPostSpecific['itunes:keywords']), 255).'</itunes:keywords>'."\n";
 
 			if($post->podPressPostSpecific['itunes:author'] == '##Global##') {
 				$post->podPressPostSpecific['itunes:author'] = $podPress->settings['iTunes']['author'];
@@ -228,7 +243,7 @@
 					$post->podPressPostSpecific['itunes:author'] = stripslashes(get_option('admin_email'));
 				}
 			}
-			echo '		<itunes:author>'.podPress_feedSafeContent($post->podPressPostSpecific['itunes:author'], true).'</itunes:author>'."\n";
+			echo '		<itunes:author>'.podPress_feedSafeContent($post->podPressPostSpecific['itunes:author']).'</itunes:author>'."\n";
 
 			if($post->podPressPostSpecific['itunes:explicit'] == 'Default') {
 				$post->podPressPostSpecific['itunes:explicit'] = $podPress->settings['iTunes']['explicit'];
@@ -253,7 +268,7 @@
 		$episodeLicenseTags = podPress_getEpisodeLicenseTags();
 		if ($episodeLicenseTags != '')
 		{
-			echo "\t" . $episodeLicenseTags;
+			echo $episodeLicenseTags;
 		}
 		if(isset($post_meta_cache[$blog_id][$post->ID]['enclosure_podPressHold'])) {
 			$post_meta_cache[$blog_id][$post->ID]['enclosure'] = $post_meta_cache[$blog_id][$post->ID]['enclosure_podPressHold'];
@@ -267,16 +282,16 @@
 		if(!isset($podPress->settings['category_data'])) {
 			podPress_feed_getCategory();
 		}
-		echo '<!-- podcast_generator="podPress/'.PODPRESS_VERSION.'" - maintenance_release="'.PODPRESS_MAINTENANCE_VERSION.'" -->'."\n";
+		echo "\t".'<!-- podcast_generator="podPress/'.PODPRESS_VERSION.'" - maintenance_release="'.PODPRESS_MAINTENANCE_VERSION.'" -->'."\n";
 		if ($podPress->settings['category_data']['categoryCasting'] == 'true' && $podPress->settings['category_data']['rss_imageChoice'] == 'Custom') {
 			echo "\t".'<logo>'.podPress_feedSafeContent($podPress->settings['category_data']['rss_image']).'</logo>'."\n";
 		} else {
 			echo "\t".'<logo>'.podPress_feedSafeContent(get_option('rss_image')).'</logo>'."\n";
 		}
 		if (empty($data['rss_copyright'])) {
-			echo '		<rights>'.podPress_feedSafeContent(__('Copyright', 'podpress').' &#xA9; '. date('Y',time())).' '.get_bloginfo('blogname').'</rights>'."\n";
+			echo "\t".'<rights>'.podPress_feedSafeContent(__('Copyright', 'podpress').' &#xA9; '. date('Y',time())).' '.get_bloginfo('blogname').'</rights>'."\n";
 		} else {
-			echo '		<rights>'.podPress_feedSafeContent($data['rss_copyright']).'</rights>'."\n";
+			echo "\t".'<rights>'.podPress_feedSafeContent($data['rss_copyright']).'</rights>'."\n";
 		}
 		if ( !empty($podPress->settings['rss_license_url']) ) {
 			echo "\t".'<link rel="license" type="text/html" href="'.$podPress->settings['rss_license_url'].'" />'."\n";
@@ -287,12 +302,12 @@
 		$enclosureTag = podPress_getEnclosureTags('atom');
 		if ($enclosureTag != '') // if no enclosure tag, no need for iTunes tags
 		{
-			echo "\t" . $enclosureTag;
+			echo $enclosureTag;
 		}
 		$episodeLicenseTags = podPress_getEpisodeLicenseTags('atom');
 		if ($episodeLicenseTags != '')
 		{
-			echo "\t" . $episodeLicenseTags;
+			echo $episodeLicenseTags;
 		}
 	}
 
@@ -304,14 +319,14 @@
 		$more = 1;
 		echo '<?xml version="1.0" encoding="'.get_settings('blog_charset').'" ?'.">\n";
 		echo '<playlist version="1" xmlns="http://xspf.org/ns/0/">'."\n";
-		echo "\t".'<title>'. get_bloginfo('blogname') . '</title>'."\n";
+		echo "\t".'<title>'. podPress_feedSafeContent(get_bloginfo('blogname')) . '</title>'."\n";
 		echo "\t".'<annotation><![CDATA['. $podPress->settings['iTunes']['summary'].']]></annotation>'."\n";
 		if (empty($podPress->settings['iTunes']['author'])) {
 			$creator = get_bloginfo('blogname');
 		} else {
 			$creator = $podPress->settings['iTunes']['author'];
 		}
-		echo "\t".'<creator>'. $creator. '</creator>'."\n";
+		echo "\t".'<creator>'. podPress_feedSafeContent($creator). '</creator>'."\n";
 		echo "\t".'<location>'.get_feed_link('playlist.xspf').'</location>'."\n";
 		if ( !empty($podPress->settings['rss_license_url']) ) {
 			echo "\t".'<license>'.$podPress->settings['rss_license_url'].'</license>'."\n";
@@ -357,9 +372,9 @@
 						case 'rss' :
 						case 'rdf' : // license tags for entries with the help of the Dublin Core
 							if (TRUE == isset($license['podcast_episode_license_url']) AND FALSE == isset($license['podcast_episode_license_name'])) {
-								$result = "\t".'<dc:rights>'.$license['podcast_episode_license_url'].'</dc:rights>'."\n";
+								$result = "\t\t".'<dc:rights>'.$license['podcast_episode_license_url'].'</dc:rights>'."\n";
 							} elseif (TRUE == isset($license['podcast_episode_license_name']) AND TRUE == isset($license['podcast_episode_license_name'])) {
-								$result = "\t".'<dc:rights>'.$license['podcast_episode_license_name'].' - '.$license['podcast_episode_license_url'].'</dc:rights>'."\n";
+								$result = "\t\t".'<dc:rights>'.podPress_feedSafeContent($license['podcast_episode_license_name']).' '.$license['podcast_episode_license_url'].'</dc:rights>'."\n";
 							}
 						break;
 						case 'atom' : // Atom License Extension -  http://tools.ietf.org/html/rfc4946
@@ -367,7 +382,7 @@
 								$result = "\t".'<rights>'.$license['podcast_episode_license_url'].'</rights>'."\n";
 								$result .= "\t".'<link rel="license" type="text/html" href="'.$license['podcast_episode_license_url'].'" />'."\n";
 							} elseif (TRUE == isset($license['podcast_episode_license_name']) AND TRUE == isset($license['podcast_episode_license_name'])) {
-								$result = "\t".'<rights>'.$license['podcast_episode_license_name'].'</rights>'."\n";
+								$result = "\t".'<rights>'.podPress_feedSafeContent($license['podcast_episode_license_name']).'</rights>'."\n";
 								$result .= "\t".'<link rel="license" type="text/html" href="'.$license['podcast_episode_license_url'].'" />'."\n";
 							}
 						break;
@@ -380,7 +395,7 @@
 		}
 		return $result;
 	}
-	
+
 	function podPress_getEnclosureTags($feedtype = 'rss2') {
 		GLOBAL $podPress, $post;
 		$result = '';
@@ -426,13 +441,13 @@
 					} elseif ($feedtype == 'xspf') {
 						$post->podPressMedia[$key]['URI'] = $podPress->convertPodcastFileNameToValidWebPath($post->podPressMedia[$key]['URI']);
 						if (podPress_getFileExt($post->podPressMedia[$key]['URI']) == 'mp3') {
-							$result .= "\t"."\t"."\t".'<location>'.$post->podPressMedia[$key]['URI']."</location>\n";
+							$result .= "\t\t\t".'<location>'.$post->podPressMedia[$key]['URI']."</location>\n";
 							if (!empty($post->podPressMedia[$key]['title'])) {
-								$result .= "\t"."\t"."\t".'<annotation>'.podPress_feedSafeContent($post->podPressMedia[$key]['title'])."</annotation>\n";
-								$result .= "\t"."\t"."\t".'<title>'.podPress_feedSafeContent($post->podPressMedia[$key]['title'])."</title>\n";
+								$result .= "\t\t\t".'<annotation>'.podPress_feedSafeContent($post->podPressMedia[$key]['title'])."</annotation>\n";
+								$result .= "\t\t\t".'<title>'.podPress_feedSafeContent($post->podPressMedia[$key]['title'])."</title>\n";
 							} else {
-								$result .= "\t"."\t"."\t".'<annotation>'.podPress_feedSafeContent($post->post_title)."</annotation>\n";
-								$result .= "\t"."\t"."\t".'<title>'.podPress_feedSafeContent($post->post_title)."</title>\n";
+								$result .= "\t\t\t".'<annotation>'.podPress_feedSafeContent($post->post_title)."</annotation>\n";
+								$result .= "\t\t\t".'<title>'.podPress_feedSafeContent($post->post_title)."</title>\n";
 							}
 							if ( '##Global##' == $post->podPressPostSpecific['itunes:author']) {
 								if (empty($podPress->settings['iTunes']['author'])) {
@@ -440,15 +455,15 @@
 								} else {
 									$creator = $podPress->settings['iTunes']['author'];
 								}
-								$result .= "\t"."\t"."\t".'<creator>'.$creator.'</creator>'."\n";
+								$result .= "\t\t\t".'<creator>'.podPress_feedSafeContent($creator).'</creator>'."\n";
 							} else {
-								$result .= "\t"."\t"."\t".'<creator>'.$post->podPressPostSpecific['itunes:author'].'</creator>'."\n";
+								$result .= "\t\t\t".'<creator>'.podPress_feedSafeContent($post->podPressPostSpecific['itunes:author']).'</creator>'."\n";
 							}
-							if ( 'UNKNOWN' != $post->podPressMedia[$key]['duration']) {
-								$result .= "\t"."\t"."\t".'<duration>'.$post->podPressMedia[$key]['duration'].'</duration>'."\n";
+							if ( 'UNKNOWN' != $post->podPressMedia[$key]['duration'] AND FALSE === empty($post->podPressMedia[$key]['duration'])) {
+								$result .= "\t\t\t".'<duration>'.podpress_strtomilliseconds($post->podPressMedia[$key]['duration']).'</duration>'."\n";
 							} 
 							if(!empty($post->podPressMedia[$key]['previewImage'])) {
-								$result .= "\t"."\t"."\t".'<image>'.$post->podPressMedia[$key]['previewImage']."</image>\n";
+								$result .= "\t\t\t".'<image>'.$post->podPressMedia[$key]['previewImage']."</image>\n";
 							}
 						}
 					} elseif ($feedtype == 'rss2') {
@@ -469,11 +484,11 @@
 							} elseif($preferredFormat) {
 								$foundPreferred = true;
 							}
-							$result = '<enclosure url="'.$post->podPressMedia[$key]['URI'].'" length="'.$post->podPressMedia[$key]['size'].'" type="'.$post->podPressMedia[$key]['mimetype'].'"/>'."\n";
-							$result .= $durationTag;
-						} elseif($preferredFormat && !$foundPreferred  AND FALSE === $same_enclosure_URL_in_postmeta_exists) {
-							$result = '<enclosure url="'.$post->podPressMedia[$key]['URI'].'" length="'.$post->podPressMedia[$key]['size'].'" type="'.$post->podPressMedia[$key]['mimetype'].'"/>'."\n";
-							$result .= $durationTag;
+							$result = "\t\t".'<enclosure url="'.$post->podPressMedia[$key]['URI'].'" length="'.$post->podPressMedia[$key]['size'].'" type="'.$post->podPressMedia[$key]['mimetype'].'"/>'."\n";
+							$result .= "\t\t".$durationTag;
+						} elseif ($preferredFormat && !$foundPreferred AND FALSE === $same_enclosure_URL_in_postmeta_exists) {
+							$result = "\t\t".'<enclosure url="'.$post->podPressMedia[$key]['URI'].'" length="'.$post->podPressMedia[$key]['size'].'" type="'.$post->podPressMedia[$key]['mimetype'].'"/>'."\n";
+							$result .= "\t\t".$durationTag;
 							$foundPreferred = true;
 						}
 					}
@@ -502,6 +517,97 @@
 		return $exists;
 	}
 
+function podpress_strtomilliseconds($durationstr) {
+	$dstr_parts=explode(':', $durationstr);
+	$nr_dstr_parts=count($dstr_parts);
+	if (1 < $nr_dstr_parts AND 5 > $nr_dstr_parts) {
+		switch ($nr_dstr_parts) {
+			case 2 :
+				// this method is only good if the input data which consist of two parts is most likely in the format m:s because 
+				// m:s
+				$duration = podpress_strtomilliseconds_core(1, 2, $dstr_parts);
+				if ($durationstr != podpress_millisecondstostring($duration)) {
+					// h:m
+					$duration = podpress_strtomilliseconds_core(0, 2, $dstr_parts);
+					if ($durationstr != podpress_millisecondstostring($duration)) {
+						// s:ms
+						$duration = podpress_strtomilliseconds_core(2, 2, $dstr_parts);
+					}
+				}
+			break;
+			case 3 :
+				// h:m:s
+				$duration = podpress_strtomilliseconds_core(0, 3, $dstr_parts);
+				if ($durationstr != podpress_millisecondstostring($duration)) {
+					// m:s:ms
+					$duration = podpress_strtomilliseconds_core(1, 3, $dstr_parts);
+				}
+			break;
+			case 4 :
+				$duration = podpress_strtomilliseconds_core(0, 4, $dstr_parts);
+			break;
+		}
+	}
+	if (!isset($duration) OR $duration < 0) {
+		$duration = 0;
+	}
+	return $duration;
+}
+
+function podpress_strtomilliseconds_core($startindex=0, $max_nr_parts=4, $dstr_parts=array()){
+	$duration = $j = 0;
+	if (!empty($dstr_parts)) {
+		for ($i=$startindex; $i < ($max_nr_parts+$startindex); $i++) {
+			switch ($i) {
+				case 0 : // hours
+					$duration += 3600000 * intval(substr($dstr_parts[$j], 0, 2));
+					$j++;
+				break;
+				case 1 : // minutes
+					$duration += 60000 * intval(substr($dstr_parts[$j], 0, 2));
+					$j++;
+				break;
+				case 2 : // seconds
+					$duration += 1000 * intval(substr($dstr_parts[$j], 0, 2));
+					$j++;
+				break;
+				case 3 : // milliseconds
+					$duration += intval(substr($dstr_parts[$j], 0, 2));
+					$j++;
+				break;
+			}
+		}
+	}
+	return $duration;
+}
+
+function podpress_millisecondstostring($duration) {
+// This function gives the milliseconds value back in the format H:M:S:MS or if the H:M:S if the milliseconds part is zero.
+// If the leading parts is zero then the return string will not contain this part.
+	$hours = intval($duration / (3600000));
+	$minutes = intval($duration / (60000) % 60);
+	$seconds = intval($duration / (1000) % 60);
+	$mseconds = intval($duration % 1000);
+	$duration_array = array($hours, $minutes, $seconds, $mseconds);
+	$dur_str ="";
+	$j=0;
+	foreach($duration_array as $key => $dur_part) {
+		if ("" == $dur_str AND 0 == $dur_part) {
+		} else {
+			if (3 == $key AND  0 == $dur_part) {
+			} else {
+				if ($j > 0) { 
+					$dur_str .= ":".strval($dur_part);
+				} else {
+					$dur_str .= strval($dur_part);
+				}
+				$j++;
+			}
+		}
+	}
+	return $dur_str;
+}
+
 	function podPress_getiTunesCategoryTags() {
 		GLOBAL $podPress, $post;
 		$result = '';
@@ -522,20 +628,18 @@
 		}
 		if(is_array($data)) {
 			foreach($data as $thiscat) {
-				if(strstr($thiscat, ':')) {
+				if (strstr($thiscat, ':')) {
 					list($cat, $subcat) = explode(":", $thiscat);
-					$result .= '<itunes:category text="'.str_replace('&', '&amp;', $cat).'">'."\n";
-					$result .= "\t".'<itunes:category text="'.str_replace('&', '&amp;', $subcat).'"/>'."\n";
-					$result .= '</itunes:category>'."\n";
+					$result .= "\t".'<itunes:category text="'.str_replace('&', '&amp;', $cat).'">'."\n";
+					$result .= "\t\t".'<itunes:category text="'.str_replace('&', '&amp;', $subcat).'" />'."\n";
+					$result .= "\t".'</itunes:category>'."\n";
+				} elseif (!empty($thiscat) AND '[ '.__('nothing', 'podpress').' ]' != $thiscat ) {
+					$result .= "\t".'<itunes:category text="'.str_replace('&', '&amp;', $thiscat).'" />'."\n";
 				}
-				elseif(!empty($thiscat))
-				{
-					$result .= '<itunes:category text="'.str_replace('&', '&amp;', $thiscat).'"/>'."\n";
-				}
 			}
 		}
 		if(empty($result)) {
-			$result .= '<itunes:category text="Society &amp; Culture"/>'."\n";
+			$result .= "\t".'<itunes:category text="Society &amp; Culture" />'."\n";
 		}
 		return $result;
 	}

