diff -x .svn -aruN 4.6.4.src/CHANGELOG.php 4.6.5.src/CHANGELOG.php
--- 4.6.4.src/CHANGELOG.php	2008-05-21 08:40:58.000000000 -0500
+++ 4.6.5.src/CHANGELOG.php	2008-06-18 13:00:59.000000000 -0500
@@ -25,6 +25,52 @@
 ! -> Change
 - -> Removed
 ! -> Note
+
+--------------------------- 4.6.5 Release -------------------------------
+
+r1740 | andphe | 2008-06-18 12:33:23 -0500 (mié, 18 jun 2008) | 1 line
+
+# fixed, FS#379 - Module titles on custom modules no longer showing 
+---
+r1739 | andphe | 2008-06-17 17:54:02 -0500 (mar, 17 jun 2008) | 1 line
+
+# adding validation when pop is empty
+---
+r1738 | andphe | 2008-06-17 06:23:40 -0500 (mar, 17 jun 2008) | 1 line
+
+# wrong Itemid generation
+---
+r1737 | andphe | 2008-06-16 22:52:00 -0500 (lun, 16 jun 2008) | 1 line
+
+! extra validating for include paths at administrator popups load
+---
+r1736 | andphe | 2008-06-16 22:43:54 -0500 (lun, 16 jun 2008) | 1 line
+
+! extra validating for include paths at _setTemplate
+---
+r1735 | andphe | 2008-06-16 22:32:00 -0500 (lun, 16 jun 2008) | 1 line
+
++ adding _VALID_MOS validation to Cache\Lite\Output.php
+---
+r1732 | neilt | 2008-05-28 07:18:48 -0500 (mié, 28 may 2008) | 1 line
+
+# bug fix - FS#342 - email validation 
+---
+r1731 | neilt | 2008-05-28 06:31:00 -0500 (mié, 28 may 2008) | 1 line
+
+# bug fix - FS#350 - Back end Menu Manager - menu entry titles are centred in column breaking indentation 
+---
+r1730 | neilt | 2008-05-28 06:20:34 -0500 (mié, 28 may 2008) | 1 line
+
++ Modification to allow redirect to content after edit/cancel - FS#355
+---
+r1729 | neilt | 2008-05-28 03:25:37 -0500 (mié, 28 may 2008) | 1 line
+
+# bug fix - FS#371 - add to check permission folder 
+---
+r1728 | neilt | 2008-05-28 02:44:07 -0500 (mié, 28 may 2008) | 1 line
+
+# fixed - FS#162 - Uploaded Banner Popup lacks CSS styling 
 
 --------------------------- 4.6.4 Release -------------------------------
 r1723 | elpie | 2008-05-21 06:54:00 -0500 (Mié, 21 May 2008) | 1 line
diff -x .svn -aruN 4.6.4.src/administrator/components/com_admin/version.xml 4.6.5.src/administrator/components/com_admin/version.xml
--- 4.6.4.src/administrator/components/com_admin/version.xml	2007-12-26 19:07:38.000000000 -0600
+++ 4.6.5.src/administrator/components/com_admin/version.xml	2008-06-18 12:42:52.000000000 -0500
@@ -1,5 +1,5 @@
 <?xml version="1.0"?>
 <mamboinfo>
-    <version>4.6.4</version>
+    <version>4.6.5</version>
     <patch></patch>
 </mamboinfo>
diff -x .svn -aruN 4.6.4.src/administrator/components/com_banners/banners.xml 4.6.5.src/administrator/components/com_banners/banners.xml
--- 4.6.4.src/administrator/components/com_banners/banners.xml	2008-01-12 01:19:14.000000000 -0600
+++ 4.6.5.src/administrator/components/com_banners/banners.xml	2008-05-23 21:29:22.000000000 -0500
@@ -7,7 +7,7 @@
   <license>http://www.opensource.org/licenses/gpl-license.php GNU/GPL v.2</license>
   <authorEmail>core@mambo-foundation.org</authorEmail>
   <authorUrl>mambo-foundation.org</authorUrl>
-  <version>4.6.x.7</version>
+  <version>1.3</version>
   <description>This component manages banners and banner clients</description>
   <administration>
 	<menu>Banners</menu>
@@ -33,7 +33,7 @@
   </files>
     <install>
 	<queries>
-	  <query>CREATE TABLE `mos_banner` (
+	  <query>CREATE TABLE IF NOT EXISTS `mos_banner` (
                  `bid` int(11) NOT NULL auto_increment,
                  `cid` int(11) NOT NULL default '0',
                  `type` varchar(10) NOT NULL default 'banner',
@@ -53,7 +53,7 @@
                  KEY `viewbanner` (`showBanner`)
                  );
 	  </query>
-	  <query>CREATE TABLE `mos_bannerclient` (
+	  <query>CREATE TABLE IF NOT EXISTS `mos_bannerclient` (
                  `cid` int(11) NOT NULL auto_increment,
                  `name` varchar(60) NOT NULL default '',
                  `contact` varchar(60) NOT NULL default '',
@@ -65,7 +65,7 @@
                  PRIMARY KEY  (`cid`)
                  );
 	  </query>
-	  <query>CREATE TABLE `mos_bannerfinish` (
+	  <query>CREATE TABLE IF NOT EXISTS `mos_bannerfinish` (
                  `bid` int(11) NOT NULL auto_increment,
                  `cid` int(11) NOT NULL default '0',
                  `type` varchar(10) NOT NULL default '',
diff -x .svn -aruN 4.6.4.src/administrator/components/com_comment/comment.xml 4.6.5.src/administrator/components/com_comment/comment.xml
--- 4.6.4.src/administrator/components/com_comment/comment.xml	2008-01-12 01:19:14.000000000 -0600
+++ 4.6.5.src/administrator/components/com_comment/comment.xml	2008-05-23 21:29:22.000000000 -0500
@@ -7,7 +7,7 @@
 	<license>http://www.opensource.org/licenses/gpl-license.php GNU/GPL v.2</license>
 	<authorEmail>core@mambo-foundation.org</authorEmail>
 	<authorUrl>mambo-foundation.org</authorUrl>
-	<version>4.6.x.7</version>
+	<version>1.1</version>
   <description>Adds a commenting feature to articles within selected sections</description>
   <files>
     <filename>comment.php</filename>
@@ -16,7 +16,7 @@
     <queries>
       <query>DROP TABLE IF EXISTS `#__comment`</query>
       <query>
-        CREATE TABLE `#__comment` (
+        CREATE TABLE IF NOT EXISTS `#__comment` (
           `id` int(10) NOT NULL auto_increment,
           `articleid` int(10) NOT NULL default '0',
           `ip` varchar(15) NOT NULL default '',
diff -x .svn -aruN 4.6.4.src/administrator/components/com_config/admin.config.html.php 4.6.5.src/administrator/components/com_config/admin.config.html.php
--- 4.6.4.src/administrator/components/com_config/admin.config.html.php	2007-12-18 10:53:38.000000000 -0600
+++ 4.6.5.src/administrator/components/com_config/admin.config.html.php	2008-05-23 06:25:34.000000000 -0500
@@ -257,15 +257,15 @@
 		</tr>
 		<tr>
 			<td width="200"><?php echo T_('Linked Titles:'); ?></td>
-			<td width="100"><?php echo $lists['link_titles']; ?></td>
+			<td width="150"><?php echo $lists['link_titles']; ?></td>
 			<td><?php
 				$tip = T_('If yes, the title of content items will be hyperlinked to the item');
 				echo mosToolTip( $tip );
 			?></td>
 		</tr>
 		<tr>
-			<td width="200"><?php echo T_('Read More Link:'); ?></td>
-			<td width="100"><?php echo $lists['readmore']; ?></td>
+			<td><?php echo T_('Read More Link:'); ?></td>
+			<td><?php echo $lists['readmore']; ?></td>
 			<td><?php
 				$tip = T_('If set to show, the read-more link will show if main-text has been provided for the item');
 				echo mosToolTip( $tip );
diff -x .svn -aruN 4.6.4.src/administrator/components/com_installer/universal/universal.php 4.6.5.src/administrator/components/com_installer/universal/universal.php
--- 4.6.4.src/administrator/components/com_installer/universal/universal.php	2007-11-13 03:59:42.000000000 -0600
+++ 4.6.5.src/administrator/components/com_installer/universal/universal.php	2008-05-28 03:25:37.000000000 -0500
@@ -1,47 +1,49 @@
-<?php
-/**
-* @package Mambo
-* @subpackage Installer
-* @author Mambo Foundation Inc see README.php
-* @copyright Mambo Foundation Inc.
-* See COPYRIGHT.php for copyright notices and details.
-* @license GNU/GPL Version 2, see LICENSE.php
-* Mambo is free software; you can redistribute it and/or
-* modify it under the terms of the GNU General Public License
-* as published by the Free Software Foundation; version 2 of the License.
-*/
-
-/** ensure this file is being included by a parent file */
-defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
-
-// ensure user has access to this function
-//if ( !$acl->acl_check( 'administration', 'install', 'users', $my->usertype, $element . 's', 'all' ) ) {
-//	mosRedirect( 'index2.php', T_('You are not authorized to view this resource.') );
-//}
-
-require_once( $mainframe->getPath( 'installer_html', 'component' ) );
-
-$suppress_install = false;
-if (!$suppress_install) {
-HTML_installer::showInstallForm( T_('Install Mambo plugin (component, module, mambot, template, include, parameter, composite)'), $option, 'universal', '', dirname(__FILE__) );
-?>
-<table class="content">
-<?php
-writableCell( 'administrator/components' );
-writableCell( 'administrator/modules' );
-writableCell( 'administrator/templates' );
-writableCell( 'components' );
-writableCell( 'mambots' );
-writableCell( 'mambots/content' );
-writableCell( 'mambots/editors' );
-writableCell( 'mambots/editors-xtd' );
-writableCell( 'mambots/search' );
-writableCell( 'media' );
-writableCell( 'modules' );
-writableCell( 'templates' );
-?>
-</table>
-<?php
-}
-
-?>
+<?php
+/**
+* @package Mambo
+* @subpackage Installer
+* @author Mambo Foundation Inc see README.php
+* @copyright Mambo Foundation Inc.
+* See COPYRIGHT.php for copyright notices and details.
+* @license GNU/GPL Version 2, see LICENSE.php
+* Mambo is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; version 2 of the License.
+*/
+
+/** ensure this file is being included by a parent file */
+defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
+
+// ensure user has access to this function
+//if ( !$acl->acl_check( 'administration', 'install', 'users', $my->usertype, $element . 's', 'all' ) ) {
+//	mosRedirect( 'index2.php', T_('You are not authorized to view this resource.') );
+//}
+
+require_once( $mainframe->getPath( 'installer_html', 'component' ) );
+
+$suppress_install = false;
+if (!$suppress_install) {
+HTML_installer::showInstallForm( T_('Install Mambo plugin (component, module, mambot, template, include, parameter, composite)'), $option, 'universal', '', dirname(__FILE__) );
+?>
+<table class="content">
+<?php
+writableCell( 'administrator/components' );
+writableCell( 'administrator/modules' );
+writableCell( 'administrator/templates' );
+writableCell( 'components' );
+writableCell( 'mambots' );
+writableCell( 'mambots/authenticator' );
+writableCell( 'mambots/content' );
+writableCell( 'mambots/editors' );
+writableCell( 'mambots/editors-xtd' );
+writableCell( 'mambots/search' );
+writableCell( 'mambots/system' );
+writableCell( 'media' );
+writableCell( 'modules' );
+writableCell( 'templates' );
+?>
+</table>
+<?php
+}
+
+?>
diff -x .svn -aruN 4.6.4.src/administrator/components/com_menus/admin.menus.html.php 4.6.5.src/administrator/components/com_menus/admin.menus.html.php
--- 4.6.4.src/administrator/components/com_menus/admin.menus.html.php	2008-05-19 05:39:46.000000000 -0500
+++ 4.6.5.src/administrator/components/com_menus/admin.menus.html.php	2008-05-28 06:31:00.000000000 -0500
@@ -1,471 +1,471 @@
-<?php
-/**
-* @package Mambo
-* @subpackage Menus
-* @author Mambo Foundation Inc see README.php
-* @copyright Mambo Foundation Inc.
-* See COPYRIGHT.php for copyright notices and details.
-* @license GNU/GPL Version 2, see LICENSE.php
-* Mambo is free software; you can redistribute it and/or
-* modify it under the terms of the GNU General Public License
-* as published by the Free Software Foundation; version 2 of the License.
-*/
-
-/** ensure this file is being included by a parent file */
-defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
-
-class HTML_menusections {
-
-	function showMenusections( $rows, $pageNav, $search, $levellist, $menutype, $option ) {
-		global $my;
-
-		mosCommonHTML::loadOverlib();
-		?>
-		<form action="index2.php" method="post" name="adminForm">
-		<table class="adminheading">
-		<tr>
-			<th class="menus">
-			<?php printf(T_('Menu Manager <small><small>[ %s ]</small></small>'), $menutype)  ?>
-			</th>
-			<td nowrap="true">
-			<?php echo T_('Max Levels'); ?>
-			</td>
-			<td>
-			<?php echo $levellist;?>
-			</td>
-			<td>
-			<?php echo T_('Filter:'); ?>
-			</td>
-			<td>
-			<input type="text" name="search" value="<?php echo $search;?>" class="inputbox" />
-			</td>
-		</tr>
-		<?php
-		if ( $menutype == 'mainmenu' ) {
-			?>
-			<tr>
-				<td align="right" nowrap style="color: red; font-weight: normal;" colspan="5">
-				* <?php echo T_('You cannot `delete` this menu as it is required for the proper operation of Mambo'); ?> *
-				<br />
-				<span style="color: black;">
-				* <?php echo T_('The 1st Published item in this menu [mainmenu] is the default `Homepage` for the site'); ?> *
-				</span>
-				</td>
-			</tr>
-			<?php
-		}
-		?>
-		</table>
-
-		<table class="adminlist">
-		<tr>
-			<th width="20">
-			#
-			</th>
-			<th width="20">
-			<input type="checkbox" name="toggle" value="" onclick="checkAll(<?php echo count($rows); ?>);" />
-			</th>
-			<th class="title" width="40%">
-			<?php echo T_('Menu Item'); ?>
-			</th>
-			<th width="5%">
-			<?php echo T_('Published'); ?>
-			</th>
-			<th colspan="2" width="5%">
-			<?php echo T_('Reorder'); ?>
-			</th>
-			<th width="2%">
-			<?php echo T_('Order'); ?>
-			</th>
-			<th width="1%">
-			<a href="javascript: saveorder( <?php echo count( $rows )-1; ?> )"><img src="images/filesave.png" border="0" width="16" height="16" alt="<?php echo T_('Save Order'); ?>" /></a>
-			</th>
-			<th width="10%">
-			<?php echo T_('Access'); ?>
-			</th>
-			<th>
-			<?php echo T_('Itemid'); ?>
-			</th>
-			<th width="35%" align="left">
-			<?php echo T_('Type'); ?>
-			</th>
-			<th>
-			<?php echo T_('CID'); ?>
-			</th>
-		</tr>
-	    <?php
-		$k = 0;
-		$i = 0;
-		$n = count( $rows );
-		foreach ($rows as $row) {
-			$access 	= mosCommonHTML::AccessProcessing( $row, $i );
-			$checked 	= mosCommonHTML::CheckedOutProcessing( $row, $i );
-			$published 	= mosCommonHTML::PublishedProcessing( $row, $i );
-			?>
-			<tr class="<?php echo "row$k"; ?>">
-				<td>
-				<?php echo $i + 1 + $pageNav->limitstart;?>
-				</td>
-				<td>
-				<?php echo $checked; ?>
-				</td>
-				<td nowrap="nowrap">
-				<?php
-				if ( $row->checked_out && ( $row->checked_out != $my->id ) ) {
-					echo $row->treename;
-				} else {
-					$link = 'index2.php?option=com_menus&menutype='. $row->menutype .'&task=edit&id='. $row->id . '&hidemainmenu=1';
-					?>
-					<a href="<?php echo $link; ?>">
-					<?php echo $row->treename; ?>
-					</a>
-					<?php
-				}
-				?>
-				</td>
-				<td width="10%" align="center">
-				<?php echo $published;?>
-				</td>
-				<td>
-				<?php echo $pageNav->orderUpIcon( $i ); ?>
-				</td>
-				<td>
-				<?php echo $pageNav->orderDownIcon( $i, $n ); ?>
-				</td>
-				<td align="center" colspan="2">
-				<input type="text" name="order[]" size="5" value="<?php echo $row->ordering; ?>" class="text_area" style="text-align: center" />
-				</td>
-				<td align="center">
-				<?php echo $access;?>
-				</td>
-				<td align="center">
-				<?php echo $row->id; ?>
-				</td>
-				<td align="left">
-				<?php
-				echo mosToolTip( T_($row->descrip), '', 280, 'tooltip.png', T_($row->type), T_($row->edit) );
-				?>
-				</td>
-				<td align="center">
-				<?php echo $row->componentid; ?>
-				</td>
-		    </tr>
-			<?php
-			$k = 1 - $k;
-			$i++;
-		}
-		?>
-		</table>
-
-		<?php echo $pageNav->getListFooter(); ?>
-
-		<input type="hidden" name="option" value="<?php echo $option; ?>" />
-		<input type="hidden" name="menutype" value="<?php echo $menutype; ?>" />
-		<input type="hidden" name="task" value="" />
-		<input type="hidden" name="boxchecked" value="0" />
-		<input type="hidden" name="hidemainmenu" value="0" />
-		</form>
-		<?php
-	}
-
-
-	/**
-	* Displays a selection list for menu item types
-	*/
-	function addMenuItem( &$cid, $menutype, $option, $types_content, $types_component, $types_link, $types_other ) {
-
-		mosCommonHTML::loadOverlib();
-		?>
-		<form action="index2.php" method="post" name="adminForm">
-		<table class="adminheading">
-		<tr>
-			<th class="menus">
-			<?php echo T_('New Menu Item'); ?>
-			</th>
-			<td valign="bottom" nowrap style="color: red;">
-			<?php //echo _MENU_GROUP; ?>
-			</td>
-		</tr>
-		</table>
-<style type="text/css">
-fieldset {
-	border: 1px solid #777;
-}
-legend {
-	font-weight: bold;
-}
-</style>
-<table class="adminform">
-	<tr>
-		<td width="50%" valign="top">
-			<fieldset>
-				<legend><?php echo T_('Content'); ?></legend>
-				<table class="adminform">
-				<?php
-				$k 		= 0;
-				$count 	= count( $types_content );
-					for ( $i=0; $i < $count; $i++ ) {
-					$row = &$types_content[$i];
-
-					$link = 'index2.php?option=com_menus&menutype='. $menutype .'&task=edit&hidemainmenu=1&type='. $row->type;
-					?>
-					<tr class="<?php echo "row$k"; ?>">
-						<td width="20">
-						<input type="radio" id="cb<?php echo $i;?>" name="type" value="<?php echo $row->type; ?>" onClick="isChecked(this.checked);" />
-						</td>
-						<td>
-						<a href="<?php echo $link; ?>">
-						<?php echo T_($row->name); ?>
-						</a>
-						</td>
-						<td align="center" width="20">
-						<?php
-						echo mosToolTip( T_($row->descrip), T_($row->name), 250 );
-						?>
-						</td>
-					</tr>
-					<?php
-					$k = 1 - $k;
-				}
-				?>
-				</table>
-			</fieldset>
-			<fieldset>
-				<legend><?php echo T_('Miscellaneous'); ?></legend>
-				<table class="adminform">
-				<?php
-				$k 		= 0;
-				$count 	= count( $types_other );
-					for ( $i=0; $i < $count; $i++ ) {
-					$row = &$types_other[$i];
-
-					$link = 'index2.php?option=com_menus&menutype='. $menutype .'&task=edit&type='. $row->type;
-					?>
-					<tr class="<?php echo "row$k"; ?>">
-						<td width="20">
-						<input type="radio" id="cb<?php echo $i;?>" name="type" value="<?php echo $row->type; ?>" onClick="isChecked(this.checked);" />
-						</td>
-						<td>
-						<a href="<?php echo $link; ?>">
-						<?php echo T_($row->name); ?>
-						</a>
-						</td>
-						<td align="center" width="20">
-						<?php
-						echo mosToolTip( T_($row->descrip), T_($row->name), 250 );
-						?>
-						</td>
-					</tr>
-					<?php
-					$k = 1 - $k;
-				}
-				?>
-				</table>
-			</fieldset>
-			* <?php echo T_('Note that some menu types appear in more that one grouping, but they are still the same menu type.'); ?>
-		</td>
-		<td width="50%" valign="top">
-			<fieldset>
-				<legend><?php echo T_('Components'); ?></legend>
-				<table class="adminform">
-				<?php
-				$k 		= 0;
-				$count 	= count( $types_component );
-					for ( $i=0; $i < $count; $i++ ) {
-					$row = &$types_component[$i];
-
-					$link = 'index2.php?option=com_menus&menutype='. $menutype .'&task=edit&type='. $row->type;
-					?>
-					<tr class="<?php echo "row$k"; ?>">
-						<td width="20">
-						<input type="radio" id="cb<?php echo $i;?>" name="type" value="<?php echo $row->type; ?>" onClick="isChecked(this.checked);" />
-						</td>
-						<td>
-						<a href="<?php echo $link; ?>">
-						<?php echo T_($row->name); ?>
-						</a>
-						</td>
-						<td align="center" width="20">
-						<?php
-						echo mosToolTip( T_($row->descrip), T_($row->name), 250 );
-						?>
-						</td>
-					</tr>
-					<?php
-					$k = 1 - $k;
-				}
-				?>
-				</table>
-			</fieldset>
-			<fieldset>
-				<legend><?php echo T_('Links'); ?></legend>
-				<table class="adminform">
-				<?php
-				$k 		= 0;
-				$count 	= count( $types_link );
-					for ( $i=0; $i < $count; $i++ ) {
-					$row = &$types_link[$i];
-
-					$link = 'index2.php?option=com_menus&menutype='. $menutype .'&task=edit&type='. $row->type;
-					?>
-					<tr class="<?php echo "row$k"; ?>">
-						<td width="20">
-						<input type="radio" id="cb<?php echo $i;?>" name="type" value="<?php echo $row->type; ?>" onClick="isChecked(this.checked);" />
-						</td>
-						<td>
-						<a href="<?php echo $link; ?>">
-						<?php echo T_($row->name); ?>
-						</a>
-						</td>
-						<td align="center" width="20">
-						<?php
-						echo mosToolTip( T_($row->descrip), T_($row->name), 250 );
-						?>
-						</td>
-					</tr>
-					<?php
-					$k = 1 - $k;
-				}
-				?>
-				</table>
-			</fieldset>
-		</td>
-	</tr>
-</table>
-
-
-
-		<input type="hidden" name="option" value="<?php echo $option; ?>" />
-		<input type="hidden" name="menutype" value="<?php echo $menutype; ?>" />
-		<input type="hidden" name="task" value="edit" />
-		<input type="hidden" name="boxchecked" value="0" />
-		<input type="hidden" name="hidemainmenu" value="0" />
-		</form>
-		<?php
-	}
-
-
-	/**
-	* Form to select Menu to move menu item(s) to
-	*/
-	function moveMenu( $option, $cid, $MenuList, $items, $menutype  ) {
-		?>
-		<form action="index2.php" method="post" name="adminForm">
-		<br />
-		<table class="adminheading">
-		<tr>
-			<th>
-			<?php echo T_('Move Menu Items'); ?>
-			</th>
-		</tr>
-		</table>
-
-		<br />
-		<table class="adminform">
-		<tr>
-			<td width="3%"></td>
-			<td align="left" valign="top" width="30%">
-			<strong><?php echo T_('Move to Menu:'); ?></strong>
-			<br />
-			<?php echo $MenuList ?>
-			<br /><br />
-			</td>
-			<td align="left" valign="top">
-			<strong>
-			<?php echo T_('Menu Items being moved:'); ?>
-			</strong>
-			<br />
-			<ol>
-			<?php
-			foreach ( $items as $item ) {
-				?>
-				<li>
-				<?php echo $item->name; ?>
-				</li>
-				<?php
-			}
-			?>
-			</ol>
-			</td>
-		</tr>
-		</table>
-		<br /><br />
-
-		<input type="hidden" name="option" value="<?php echo $option;?>" />
-		<input type="hidden" name="boxchecked" value="1" />
-		<input type="hidden" name="task" value="" />
-		<input type="hidden" name="menutype" value="<?php echo $menutype; ?>" />
-		<?php
-		foreach ( $cid as $id ) {
-			echo "\n <input type=\"hidden\" name=\"cid[]\" value=\"$id\" />";
-		}
-		?>
-		</form>
-		<?php
-	}
-
-
-	/**
-	* Form to select Menu to copy menu item(s) to
-	*/
-	function copyMenu( $option, $cid, $MenuList, $items, $menutype  ) {
-		?>
-		<form action="index2.php" method="post" name="adminForm">
-		<br />
-		<table class="adminheading">
-		<tr>
-			<th>
-			<?php echo T_('Copy Menu Items'); ?>
-			</th>
-		</tr>
-		</table>
-
-		<br />
-		<table class="adminform">
-		<tr>
-			<td width="3%"></td>
-			<td align="left" valign="top" width="30%">
-			<strong>
-			<?php echo T_('Copy to Menu:'); ?>
-			</strong>
-			<br />
-			<?php echo $MenuList ?>
-			<br /><br />
-			</td>
-			<td align="left" valign="top">
-			<strong>
-			<?php echo T_('Menu Items being copied:'); ?>
-			</strong>
-			<br />
-			<ol>
-			<?php
-			foreach ( $items as $item ) {
-				?>
-				<li>
-				<?php echo $item->name; ?>
-				</li>
-				<?php
-			}
-			?>
-			</ol>
-			</td>
-		</tr>
-		</table>
-		<br /><br />
-
-		<input type="hidden" name="option" value="<?php echo $option;?>" />
-		<input type="hidden" name="boxchecked" value="0" />
-		<input type="hidden" name="task" value="" />
-		<input type="hidden" name="menutype" value="<?php echo $menutype; ?>" />
-		<?php
-		foreach ( $cid as $id ) {
-			echo "\n <input type=\"hidden\" name=\"cid[]\" value=\"$id\" />";
-		}
-		?>
-		</form>
-		<?php
-	}
-
-
-}
+<?php
+/**
+* @package Mambo
+* @subpackage Menus
+* @author Mambo Foundation Inc see README.php
+* @copyright Mambo Foundation Inc.
+* See COPYRIGHT.php for copyright notices and details.
+* @license GNU/GPL Version 2, see LICENSE.php
+* Mambo is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; version 2 of the License.
+*/
+
+/** ensure this file is being included by a parent file */
+defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
+
+class HTML_menusections {
+
+	function showMenusections( $rows, $pageNav, $search, $levellist, $menutype, $option ) {
+		global $my;
+
+		mosCommonHTML::loadOverlib();
+		?>
+		<form action="index2.php" method="post" name="adminForm">
+		<table class="adminheading">
+		<tr>
+			<th class="menus">
+			<?php printf(T_('Menu Manager <small><small>[ %s ]</small></small>'), $menutype)  ?>
+			</th>
+			<td nowrap="true">
+			<?php echo T_('Max Levels'); ?>
+			</td>
+			<td>
+			<?php echo $levellist;?>
+			</td>
+			<td>
+			<?php echo T_('Filter:'); ?>
+			</td>
+			<td>
+			<input type="text" name="search" value="<?php echo $search;?>" class="inputbox" />
+			</td>
+		</tr>
+		<?php
+		if ( $menutype == 'mainmenu' ) {
+			?>
+			<tr>
+				<td align="right" nowrap style="color: red; font-weight: normal;" colspan="5">
+				* <?php echo T_('You cannot `delete` this menu as it is required for the proper operation of Mambo'); ?> *
+				<br />
+				<span style="color: black;">
+				* <?php echo T_('The 1st Published item in this menu [mainmenu] is the default `Homepage` for the site'); ?> *
+				</span>
+				</td>
+			</tr>
+			<?php
+		}
+		?>
+		</table>
+
+		<table class="adminlist">
+		<tr>
+			<th width="20">
+			#
+			</th>
+			<th width="20">
+			<input type="checkbox" name="toggle" value="" onclick="checkAll(<?php echo count($rows); ?>);" />
+			</th>
+			<th class="title" width="40%">
+			<?php echo T_('Menu Item'); ?>
+			</th>
+			<th width="5%">
+			<?php echo T_('Published'); ?>
+			</th>
+			<th colspan="2" width="5%">
+			<?php echo T_('Reorder'); ?>
+			</th>
+			<th width="2%">
+			<?php echo T_('Order'); ?>
+			</th>
+			<th width="1%">
+			<a href="javascript: saveorder( <?php echo count( $rows )-1; ?> )"><img src="images/filesave.png" border="0" width="16" height="16" alt="<?php echo T_('Save Order'); ?>" /></a>
+			</th>
+			<th width="10%">
+			<?php echo T_('Access'); ?>
+			</th>
+			<th>
+			<?php echo T_('Itemid'); ?>
+			</th>
+			<th width="35%" align="left">
+			<?php echo T_('Type'); ?>
+			</th>
+			<th>
+			<?php echo T_('CID'); ?>
+			</th>
+		</tr>
+	    <?php
+		$k = 0;
+		$i = 0;
+		$n = count( $rows );
+		foreach ($rows as $row) {
+			$access 	= mosCommonHTML::AccessProcessing( $row, $i );
+			$checked 	= mosCommonHTML::CheckedOutProcessing( $row, $i );
+			$published 	= mosCommonHTML::PublishedProcessing( $row, $i );
+			?>
+			<tr class="<?php echo "row$k"; ?>">
+				<td>
+				<?php echo $i + 1 + $pageNav->limitstart;?>
+				</td>
+				<td>
+				<?php echo $checked; ?>
+				</td>
+				<td nowrap="nowrap" align="left">
+				<?php
+				if ( $row->checked_out && ( $row->checked_out != $my->id ) ) {
+					echo $row->treename;
+				} else {
+					$link = 'index2.php?option=com_menus&menutype='. $row->menutype .'&task=edit&id='. $row->id . '&hidemainmenu=1';
+					?>
+					<a href="<?php echo $link; ?>">
+					<?php echo $row->treename; ?>
+					</a>
+					<?php
+				}
+				?>
+				</td>
+				<td width="10%" align="center">
+				<?php echo $published;?>
+				</td>
+				<td>
+				<?php echo $pageNav->orderUpIcon( $i ); ?>
+				</td>
+				<td>
+				<?php echo $pageNav->orderDownIcon( $i, $n ); ?>
+				</td>
+				<td align="center" colspan="2">
+				<input type="text" name="order[]" size="5" value="<?php echo $row->ordering; ?>" class="text_area" style="text-align: center" />
+				</td>
+				<td align="center">
+				<?php echo $access;?>
+				</td>
+				<td align="center">
+				<?php echo $row->id; ?>
+				</td>
+				<td align="left">
+				<?php
+				echo mosToolTip( T_($row->descrip), '', 280, 'tooltip.png', T_($row->type), T_($row->edit) );
+				?>
+				</td>
+				<td align="center">
+				<?php echo $row->componentid; ?>
+				</td>
+		    </tr>
+			<?php
+			$k = 1 - $k;
+			$i++;
+		}
+		?>
+		</table>
+
+		<?php echo $pageNav->getListFooter(); ?>
+
+		<input type="hidden" name="option" value="<?php echo $option; ?>" />
+		<input type="hidden" name="menutype" value="<?php echo $menutype; ?>" />
+		<input type="hidden" name="task" value="" />
+		<input type="hidden" name="boxchecked" value="0" />
+		<input type="hidden" name="hidemainmenu" value="0" />
+		</form>
+		<?php
+	}
+
+
+	/**
+	* Displays a selection list for menu item types
+	*/
+	function addMenuItem( &$cid, $menutype, $option, $types_content, $types_component, $types_link, $types_other ) {
+
+		mosCommonHTML::loadOverlib();
+		?>
+		<form action="index2.php" method="post" name="adminForm">
+		<table class="adminheading">
+		<tr>
+			<th class="menus">
+			<?php echo T_('New Menu Item'); ?>
+			</th>
+			<td valign="bottom" nowrap style="color: red;">
+			<?php //echo _MENU_GROUP; ?>
+			</td>
+		</tr>
+		</table>
+<style type="text/css">
+fieldset {
+	border: 1px solid #777;
+}
+legend {
+	font-weight: bold;
+}
+</style>
+<table class="adminform">
+	<tr>
+		<td width="50%" valign="top">
+			<fieldset>
+				<legend><?php echo T_('Content'); ?></legend>
+				<table class="adminform">
+				<?php
+				$k 		= 0;
+				$count 	= count( $types_content );
+					for ( $i=0; $i < $count; $i++ ) {
+					$row = &$types_content[$i];
+
+					$link = 'index2.php?option=com_menus&menutype='. $menutype .'&task=edit&hidemainmenu=1&type='. $row->type;
+					?>
+					<tr class="<?php echo "row$k"; ?>">
+						<td width="20">
+						<input type="radio" id="cb<?php echo $i;?>" name="type" value="<?php echo $row->type; ?>" onClick="isChecked(this.checked);" />
+						</td>
+						<td>
+						<a href="<?php echo $link; ?>">
+						<?php echo T_($row->name); ?>
+						</a>
+						</td>
+						<td align="center" width="20">
+						<?php
+						echo mosToolTip( T_($row->descrip), T_($row->name), 250 );
+						?>
+						</td>
+					</tr>
+					<?php
+					$k = 1 - $k;
+				}
+				?>
+				</table>
+			</fieldset>
+			<fieldset>
+				<legend><?php echo T_('Miscellaneous'); ?></legend>
+				<table class="adminform">
+				<?php
+				$k 		= 0;
+				$count 	= count( $types_other );
+					for ( $i=0; $i < $count; $i++ ) {
+					$row = &$types_other[$i];
+
+					$link = 'index2.php?option=com_menus&menutype='. $menutype .'&task=edit&type='. $row->type;
+					?>
+					<tr class="<?php echo "row$k"; ?>">
+						<td width="20">
+						<input type="radio" id="cb<?php echo $i;?>" name="type" value="<?php echo $row->type; ?>" onClick="isChecked(this.checked);" />
+						</td>
+						<td>
+						<a href="<?php echo $link; ?>">
+						<?php echo T_($row->name); ?>
+						</a>
+						</td>
+						<td align="center" width="20">
+						<?php
+						echo mosToolTip( T_($row->descrip), T_($row->name), 250 );
+						?>
+						</td>
+					</tr>
+					<?php
+					$k = 1 - $k;
+				}
+				?>
+				</table>
+			</fieldset>
+			* <?php echo T_('Note that some menu types appear in more that one grouping, but they are still the same menu type.'); ?>
+		</td>
+		<td width="50%" valign="top">
+			<fieldset>
+				<legend><?php echo T_('Components'); ?></legend>
+				<table class="adminform">
+				<?php
+				$k 		= 0;
+				$count 	= count( $types_component );
+					for ( $i=0; $i < $count; $i++ ) {
+					$row = &$types_component[$i];
+
+					$link = 'index2.php?option=com_menus&menutype='. $menutype .'&task=edit&type='. $row->type;
+					?>
+					<tr class="<?php echo "row$k"; ?>">
+						<td width="20">
+						<input type="radio" id="cb<?php echo $i;?>" name="type" value="<?php echo $row->type; ?>" onClick="isChecked(this.checked);" />
+						</td>
+						<td>
+						<a href="<?php echo $link; ?>">
+						<?php echo T_($row->name); ?>
+						</a>
+						</td>
+						<td align="center" width="20">
+						<?php
+						echo mosToolTip( T_($row->descrip), T_($row->name), 250 );
+						?>
+						</td>
+					</tr>
+					<?php
+					$k = 1 - $k;
+				}
+				?>
+				</table>
+			</fieldset>
+			<fieldset>
+				<legend><?php echo T_('Links'); ?></legend>
+				<table class="adminform">
+				<?php
+				$k 		= 0;
+				$count 	= count( $types_link );
+					for ( $i=0; $i < $count; $i++ ) {
+					$row = &$types_link[$i];
+
+					$link = 'index2.php?option=com_menus&menutype='. $menutype .'&task=edit&type='. $row->type;
+					?>
+					<tr class="<?php echo "row$k"; ?>">
+						<td width="20">
+						<input type="radio" id="cb<?php echo $i;?>" name="type" value="<?php echo $row->type; ?>" onClick="isChecked(this.checked);" />
+						</td>
+						<td>
+						<a href="<?php echo $link; ?>">
+						<?php echo T_($row->name); ?>
+						</a>
+						</td>
+						<td align="center" width="20">
+						<?php
+						echo mosToolTip( T_($row->descrip), T_($row->name), 250 );
+						?>
+						</td>
+					</tr>
+					<?php
+					$k = 1 - $k;
+				}
+				?>
+				</table>
+			</fieldset>
+		</td>
+	</tr>
+</table>
+
+
+
+		<input type="hidden" name="option" value="<?php echo $option; ?>" />
+		<input type="hidden" name="menutype" value="<?php echo $menutype; ?>" />
+		<input type="hidden" name="task" value="edit" />
+		<input type="hidden" name="boxchecked" value="0" />
+		<input type="hidden" name="hidemainmenu" value="0" />
+		</form>
+		<?php
+	}
+
+
+	/**
+	* Form to select Menu to move menu item(s) to
+	*/
+	function moveMenu( $option, $cid, $MenuList, $items, $menutype  ) {
+		?>
+		<form action="index2.php" method="post" name="adminForm">
+		<br />
+		<table class="adminheading">
+		<tr>
+			<th>
+			<?php echo T_('Move Menu Items'); ?>
+			</th>
+		</tr>
+		</table>
+
+		<br />
+		<table class="adminform">
+		<tr>
+			<td width="3%"></td>
+			<td align="left" valign="top" width="30%">
+			<strong><?php echo T_('Move to Menu:'); ?></strong>
+			<br />
+			<?php echo $MenuList ?>
+			<br /><br />
+			</td>
+			<td align="left" valign="top">
+			<strong>
+			<?php echo T_('Menu Items being moved:'); ?>
+			</strong>
+			<br />
+			<ol>
+			<?php
+			foreach ( $items as $item ) {
+				?>
+				<li>
+				<?php echo $item->name; ?>
+				</li>
+				<?php
+			}
+			?>
+			</ol>
+			</td>
+		</tr>
+		</table>
+		<br /><br />
+
+		<input type="hidden" name="option" value="<?php echo $option;?>" />
+		<input type="hidden" name="boxchecked" value="1" />
+		<input type="hidden" name="task" value="" />
+		<input type="hidden" name="menutype" value="<?php echo $menutype; ?>" />
+		<?php
+		foreach ( $cid as $id ) {
+			echo "\n <input type=\"hidden\" name=\"cid[]\" value=\"$id\" />";
+		}
+		?>
+		</form>
+		<?php
+	}
+
+
+	/**
+	* Form to select Menu to copy menu item(s) to
+	*/
+	function copyMenu( $option, $cid, $MenuList, $items, $menutype  ) {
+		?>
+		<form action="index2.php" method="post" name="adminForm">
+		<br />
+		<table class="adminheading">
+		<tr>
+			<th>
+			<?php echo T_('Copy Menu Items'); ?>
+			</th>
+		</tr>
+		</table>
+
+		<br />
+		<table class="adminform">
+		<tr>
+			<td width="3%"></td>
+			<td align="left" valign="top" width="30%">
+			<strong>
+			<?php echo T_('Copy to Menu:'); ?>
+			</strong>
+			<br />
+			<?php echo $MenuList ?>
+			<br /><br />
+			</td>
+			<td align="left" valign="top">
+			<strong>
+			<?php echo T_('Menu Items being copied:'); ?>
+			</strong>
+			<br />
+			<ol>
+			<?php
+			foreach ( $items as $item ) {
+				?>
+				<li>
+				<?php echo $item->name; ?>
+				</li>
+				<?php
+			}
+			?>
+			</ol>
+			</td>
+		</tr>
+		</table>
+		<br /><br />
+
+		<input type="hidden" name="option" value="<?php echo $option;?>" />
+		<input type="hidden" name="boxchecked" value="0" />
+		<input type="hidden" name="task" value="" />
+		<input type="hidden" name="menutype" value="<?php echo $menutype; ?>" />
+		<?php
+		foreach ( $cid as $id ) {
+			echo "\n <input type=\"hidden\" name=\"cid[]\" value=\"$id\" />";
+		}
+		?>
+		</form>
+		<?php
+	}
+
+
+}
 ?>
\ No newline at end of file
diff -x .svn -aruN 4.6.4.src/administrator/components/com_poll/poll.xml 4.6.5.src/administrator/components/com_poll/poll.xml
--- 4.6.4.src/administrator/components/com_poll/poll.xml	2008-01-12 01:19:14.000000000 -0600
+++ 4.6.5.src/administrator/components/com_poll/poll.xml	2008-05-23 21:29:22.000000000 -0500
@@ -7,7 +7,7 @@
 	<license>http://www.opensource.org/licenses/gpl-license.php GNU/GPL v.2</license>
 	<authorEmail>core@mambo-foundation.org</authorEmail>
 	<authorUrl>mambo-foundation.org</authorUrl>
-	<version>4.6.x.7</version>
+	<version>1.1</version>
 	<description>This component shows Polls/Surveys</description>
 	<administration>
 	<menu link="option=com_poll">Polls</menu>
@@ -31,7 +31,7 @@
     </files>
     <install>
 	<queries>
-	  <query>CREATE TABLE `mos_polls` (
+	  <query>CREATE TABLE IF NOT EXISTS `mos_polls` (
                  `id` int(11) unsigned NOT NULL auto_increment,
                  `title` varchar(100) NOT NULL default '',
                  `voters` int(9) NOT NULL default '0',
@@ -43,7 +43,7 @@
                  PRIMARY KEY  (`id`)
                  );
 	  </query>
-	  <query>CREATE TABLE `mos_poll_data` (
+	  <query>CREATE TABLE IF NOT EXISTS `mos_poll_data` (
                  `id` int(11) NOT NULL auto_increment,
                  `pollid` int(4) NOT NULL default '0',
                  `text` text NOT NULL,
@@ -52,7 +52,7 @@
                  KEY `pollid` (`pollid`,`text`(1))
                  );
 	  </query>
-	  <query>CREATE TABLE `mos_poll_date` (
+	  <query>CREATE TABLE IF NOT EXISTS `mos_poll_date` (
                  `id` bigint(20) NOT NULL auto_increment,
                  `date` datetime NOT NULL default '0000-00-00 00:00:00',
                  `vote_id` int(11) NOT NULL default '0',
@@ -61,7 +61,7 @@
                  KEY `poll_id` (`poll_id`)
                  );
 	  </query>
-	  <query>CREATE TABLE `mos_poll_menu` (
+	  <query>CREATE TABLE IF NOT EXISTS `mos_poll_menu` (
                  `pollid` int(11) NOT NULL default '0',
                  `menuid` int(11) NOT NULL default '0',
                  PRIMARY KEY  (`pollid`,`menuid`)
diff -x .svn -aruN 4.6.4.src/administrator/components/com_weblinks/weblinks.xml 4.6.5.src/administrator/components/com_weblinks/weblinks.xml
--- 4.6.4.src/administrator/components/com_weblinks/weblinks.xml	2008-01-12 01:19:14.000000000 -0600
+++ 4.6.5.src/administrator/components/com_weblinks/weblinks.xml	2008-05-23 21:29:22.000000000 -0500
@@ -7,7 +7,7 @@
 	<license>http://www.opensource.org/licenses/gpl-license.php GNU/GPL v.2</license>
 	<authorEmail>core@mambo-foundation.org</authorEmail>
 	<authorUrl>mambo-foundation.org</authorUrl>
-	<version>4.6.x.7</version>
+	<version>1.2</version>
 	<description>This component shows a listing of Weblinks</description>
 	  <administration>
 	<menu>Web Links</menu>
@@ -32,7 +32,7 @@
   </files>
     <install>
 	<queries>
-	  <query>CREATE TABLE `mos_weblinks` (
+	  <query>CREATE TABLE IF NOT EXISTS `mos_weblinks` (
                  `id` int(11) unsigned NOT NULL auto_increment,
                  `catid` int(11) NOT NULL default '0',
                  `sid` int(11) NOT NULL default '0',
diff -x .svn -aruN 4.6.4.src/administrator/popups/uploadimage.php 4.6.5.src/administrator/popups/uploadimage.php
--- 4.6.4.src/administrator/popups/uploadimage.php	2007-11-13 03:59:42.000000000 -0600
+++ 4.6.5.src/administrator/popups/uploadimage.php	2008-06-27 22:00:51.000000000 -0500
@@ -1,109 +1,109 @@
-<?php
-/**
-* @package Mambo
-* @author Mambo Foundation Inc see README.php
-* @copyright Mambo Foundation Inc.
-* See COPYRIGHT.php for copyright notices and details.
-* @license GNU/GPL Version 2, see LICENSE.php
-* Mambo is free software; you can redistribute it and/or
-* modify it under the terms of the GNU General Public License
-* as published by the Free Software Foundation; version 2 of the License.
-*/
-
-
-//$adminside = 3;
-//require_once('../../index.php');
-
-$directory = mosGetParam( $_REQUEST, 'directory', '');
-
-$userfile2=(isset($_FILES['userfile']['tmp_name']) ? $_FILES['userfile']['tmp_name'] : "");
-$userfile_name=(isset($_FILES['userfile']['name']) ? $_FILES['userfile']['name'] : "");
-
-if (isset($_FILES['userfile'])) {
-	if ($directory!="banners") {
-		$base_Dir = "../images/stories/";
-	} else {
-		$base_Dir = "../images/banners/";
-	}
-	if (empty($userfile_name)) {
-		echo "<script>alert('".T_('Please select an image to upload') ."'); document.location.href='uploadimage.php';</script>";
-	}
-
-	$filename = split("\.", $userfile_name);
-
-	if (eregi("[^0-9a-zA-Z_]", $filename[0])) {
-		echo "<script> alert('".T_('File must only contain alphanumeric characters and no spaces please.') ."'); window.history.go(-1);</script>\n";
-		exit();
-	}
-
-	if (file_exists($base_Dir.$userfile_name)) {
-		echo "<script> alert('".sprintf(T_('Image %s already exists.'),$userfile_name) ."'); window.history.go(-1);</script>\n";
-		exit();
-	}
-
-	if ((strcasecmp(substr($userfile_name,-4),".gif")) && (strcasecmp(substr($userfile_name,-4),".jpg")) && (strcasecmp(substr($userfile_name,-4),".png")) && (strcasecmp(substr($userfile_name,-4),".bmp")) &&(strcasecmp(substr($userfile_name,-4),".doc")) && (strcasecmp(substr($userfile_name,-4),".xls")) && (strcasecmp(substr($userfile_name,-4),".ppt")) && (strcasecmp(substr($userfile_name,-4),".swf")) && (strcasecmp(substr($userfile_name,-4),".pdf"))) {
-		echo "<script>alert('".T_('The file must be gif, png, jpg, bmp, swf, doc, xls or ppt') ."'); window.history.go(-1);</script>\n";
-		exit();
-	}
-
-
-	if (eregi(".pdf", $userfile_name) || eregi(".doc", $userfile_name) || eregi(".xls", $userfile_name) || eregi(".ppt", $userfile_name)) {
-		if (!move_uploaded_file ($_FILES['userfile']['tmp_name'],$media_path.$_FILES['userfile']['name']) || !mosChmod($media_path.$_FILES['userfile']['name'])) {
-			echo "<script>alert('".sprintf(T_('Upload of %s failed'), $userfile_name) ."'); window.history.go(-1);</script>\n";
-			exit();
-		}
-		else {
-			echo "<script>alert('".sprintf(T_('Upload of %s to %s successful'), $userfile_name, $media_path) ."'); window.history.go(-1);</script>\n";
-			exit();
-		}
-	} elseif (!move_uploaded_file ($_FILES['userfile']['tmp_name'],$base_Dir.$_FILES['userfile']['name']) || !mosChmod($base_Dir.$_FILES['userfile']['name'])) {
-		echo "<script>alert('".sprintf(T_('Upload of %s failed'), $userfile_name) ."'); window.history.go(-1);</script>\n";
-		exit();
-	}
-	else {
-		echo "<script>alert('".sprintf(T_('Upload of %s to %s successful'), $userfile_name, $base_Dir) ."'); window.history.go(-1);</script>\n";
-		exit();
-	}
-
-
-}
-
-$iso = split( '=', _ISO );
-// xml prolog
-echo '<?xml version="1.0" encoding="'. $iso[1] .'"?' .'>';
-?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<title>Upload a file</title>
-<meta http-equiv="Content-Type" content="text/html; <?php echo _ISO; ?>" />
-<?php
-$css = mosGetParam($_REQUEST,"t","");
-?>
-<link rel="stylesheet" href="../templates/<?php echo $css; ?>/css/template_css.css" type="text/css" />
-</head>
-<body>
-<table class="adminform">
-  <form method="post" action="index3.php?pop=uploadimage.php" enctype="multipart/form-data" name="filename">
-    <tr>
-      <th class="title"> <?php echo T_('File Upload :') ?> <?php echo $directory; ?></th>
-    </tr>
-    <tr>
-      <td align="center">
-        <input class="inputbox" name="userfile" type="file" />
-      </td>
-    </tr>
-    <tr>
-      <td>
-        <input class="button" type="submit" value="Upload" name="fileupload" />
-        <?php echo T_('Max size') ?> = <?php echo ini_get( 'post_max_size' );?>
-      </td>
-    <tr>
-      <td>
-        <input type="hidden" name="directory" value="<?php echo $directory;?>" />
-      </td>
-    </tr>
-  </form>
-</table>
-</body>
+<?php
+/**
+* @package Mambo
+* @author Mambo Foundation Inc see README.php
+* @copyright Mambo Foundation Inc.
+* See COPYRIGHT.php for copyright notices and details.
+* @license GNU/GPL Version 2, see LICENSE.php
+* Mambo is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; version 2 of the License.
+*/
+
+
+/** ensure this file is being included by a parent file */
+defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
+
+$directory = mosGetParam( $_REQUEST, 'directory', '');
+
+$userfile2=(isset($_FILES['userfile']['tmp_name']) ? $_FILES['userfile']['tmp_name'] : "");
+$userfile_name=(isset($_FILES['userfile']['name']) ? $_FILES['userfile']['name'] : "");
+
+if (isset($_FILES['userfile'])) {
+	if ($directory!="banners") {
+		$base_Dir = "../images/stories/";
+	} else {
+		$base_Dir = "../images/banners/";
+	}
+	if (empty($userfile_name)) {
+		echo "<script>alert('".T_('Please select an image to upload') ."'); document.location.href='uploadimage.php';</script>";
+	}
+
+	$filename = split("\.", $userfile_name);
+
+	if (eregi("[^0-9a-zA-Z_]", $filename[0])) {
+		echo "<script> alert('".T_('File must only contain alphanumeric characters and no spaces please.') ."'); window.history.go(-1);</script>\n";
+		exit();
+	}
+
+	if (file_exists($base_Dir.$userfile_name)) {
+		echo "<script> alert('".sprintf(T_('Image %s already exists.'),$userfile_name) ."'); window.history.go(-1);</script>\n";
+		exit();
+	}
+
+	if ((strcasecmp(substr($userfile_name,-4),".gif")) && (strcasecmp(substr($userfile_name,-4),".jpg")) && (strcasecmp(substr($userfile_name,-4),".png")) && (strcasecmp(substr($userfile_name,-4),".bmp")) &&(strcasecmp(substr($userfile_name,-4),".doc")) && (strcasecmp(substr($userfile_name,-4),".xls")) && (strcasecmp(substr($userfile_name,-4),".ppt")) && (strcasecmp(substr($userfile_name,-4),".swf")) && (strcasecmp(substr($userfile_name,-4),".pdf"))) {
+		echo "<script>alert('".T_('The file must be gif, png, jpg, bmp, swf, doc, xls or ppt') ."'); window.history.go(-1);</script>\n";
+		exit();
+	}
+
+
+	if (eregi(".pdf", $userfile_name) || eregi(".doc", $userfile_name) || eregi(".xls", $userfile_name) || eregi(".ppt", $userfile_name)) {
+		if (!move_uploaded_file ($_FILES['userfile']['tmp_name'],$media_path.$_FILES['userfile']['name']) || !mosChmod($media_path.$_FILES['userfile']['name'])) {
+			echo "<script>alert('".sprintf(T_('Upload of %s failed'), $userfile_name) ."'); window.history.go(-1);</script>\n";
+			exit();
+		}
+		else {
+			echo "<script>alert('".sprintf(T_('Upload of %s to %s successful'), $userfile_name, $media_path) ."'); window.history.go(-1);</script>\n";
+			exit();
+		}
+	} elseif (!move_uploaded_file ($_FILES['userfile']['tmp_name'],$base_Dir.$_FILES['userfile']['name']) || !mosChmod($base_Dir.$_FILES['userfile']['name'])) {
+		echo "<script>alert('".sprintf(T_('Upload of %s failed'), $userfile_name) ."'); window.history.go(-1);</script>\n";
+		exit();
+	}
+	else {
+		echo "<script>alert('".sprintf(T_('Upload of %s to %s successful'), $userfile_name, $base_Dir) ."'); window.history.go(-1);</script>\n";
+		exit();
+	}
+
+
+}
+
+$iso = split( '=', _ISO );
+// xml prolog
+echo '<?xml version="1.0" encoding="'. $iso[1] .'"?' .'>';
+?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Upload a file</title>
+<meta http-equiv="Content-Type" content="text/html; <?php echo _ISO; ?>" />
+<?php
+$css = mosGetParam($_REQUEST,"t","");
+?>
+<link rel="stylesheet" href="templates/<?php echo $css; ?>/css/template_css.css" type="text/css" />
+</head>
+<body>
+<table class="adminform">
+  <form method="post" action="index3.php?pop=uploadimage.php" enctype="multipart/form-data" name="filename">
+    <tr>
+      <th class="title"> <?php echo T_('File Upload :') ?> <?php echo $directory; ?></th>
+    </tr>
+    <tr>
+      <td align="center">
+        <input class="inputbox" name="userfile" type="file" />
+      </td>
+    </tr>
+    <tr>
+      <td>
+        <input class="button" type="submit" value="Upload" name="fileupload" />
+        <?php echo T_('Max size') ?> = <?php echo ini_get( 'post_max_size' );?>
+      </td>
+    <tr>
+      <td>
+        <input type="hidden" name="directory" value="<?php echo $directory;?>" />
+      </td>
+    </tr>
+  </form>
+</table>
+</body>
 </html>
\ No newline at end of file
diff -x .svn -aruN 4.6.4.src/components/com_content/content.html.php 4.6.5.src/components/com_content/content.html.php
--- 4.6.4.src/components/com_content/content.html.php	2008-03-24 06:21:00.000000000 -0500
+++ 4.6.5.src/components/com_content/content.html.php	2008-06-17 06:23:40.000000000 -0500
@@ -413,7 +413,7 @@
 			// checks if the item is a public or registered/special item
 			if ( $row->access <= $gid ) {
 				if ($task != "view") {
-					$_Itemid = $mainframe->getItemid( $row->id, 0, 0, $ItemidCount['bs'], $ItemidCount['bc'], $ItemidCount['gbs'] );
+					$_Itemid = $mainframe->getItemid( $row->id, 1, 1, $ItemidCount['bs'], $ItemidCount['bc'], $ItemidCount['gbs'] );
 				}
 				$link_on = sefRelToAbs("index.php?option=com_content&amp;task=view&amp;id=".$row->id."&amp;Itemid=".$_Itemid);
 				if ( strlen( trim( $row->fulltext ) )) {
diff -x .svn -aruN 4.6.4.src/components/com_content/content.php 4.6.5.src/components/com_content/content.php
--- 4.6.4.src/components/com_content/content.php	2008-05-22 05:59:32.000000000 -0500
+++ 4.6.5.src/components/com_content/content.php	2008-05-28 06:20:34.000000000 -0500
@@ -1052,7 +1052,6 @@
 	$row = new mosExtendedContent();
 
 	if ( $database->loadObject( $row ) ) {
-                $row->_db->_sql = ""; //workaround to avoid unwanted cache refresh, I could be better
 		$pathway =& mosPathway::getInstance();
 		$pathway->addItem($row->category, categoryURL($row->sectionid, $row->catid));
 		$pathway->addItem($row->title, '');
@@ -1112,9 +1111,9 @@
 function show( $row, $params, $gid, &$access, $pop, $option, $ItemidCount=NULL ) {
 	global $database, $mainframe, $Itemid;
 	global $mosConfig_live_site, $mosConfig_absolute_path;
-	global $options, $task;
+	global $options, $task;
 
-	//$cache = mosCache::getCache('com_content','Output');
+	//$cache = mosCache::getCache('com_content','Output');
 
 	$noauth = !$mainframe->getCfg( 'shownoauth' );
 
@@ -1220,11 +1219,10 @@
 		$obj = new mosContent( $database );
 		$obj->hit( $row->id );
 	}
-
-    //if(!($cache->start($task.$row->id.$page,'com_content'))){
-        HTML_content::show( $row, $params, $access, $page, $option, $ItemidCount );
-    //    $cache->end();
-    //}
+    //if(!($cache->start($task.$row->id.$page,'com_content'))){
+        HTML_content::show( $row, $params, $access, $page, $option, $ItemidCount );
+    //    $cache->end();
+    //}
 }
 
 
@@ -1460,7 +1458,9 @@
 	}
  	$Itemid 	= mosGetParam( $_POST, 'Returnid', '0' );
  	$msg 	= $isNew ? T_('Thanks for your submission; it will be reviewed before being posted to the site.') : T_('Item saved successfully.');
-	mosRedirect( 'index.php', $msg );
+	
+	$link = $isNew ? 'index.php' : sefRelToAbs( 'index.php?option=com_content&task=view&id='.$row->id.'&Itemid='.$Itemid );
+	mosRedirect( $link, $msg);
 }
 
 
@@ -1482,7 +1482,8 @@
 
 	$Itemid = mosGetParam( $_POST, 'Returnid', '0' );
 
-	mosRedirect( 'index.php' );
+	$link = sefRelToAbs( 'index.php?option=com_content&task=view&id='.$row->id.'&Itemid='.$Itemid );
+	mosRedirect( $link );
 }
 
 /**
diff -x .svn -aruN 4.6.4.src/components/com_registration/registration.html.php 4.6.5.src/components/com_registration/registration.html.php
--- 4.6.4.src/components/com_registration/registration.html.php	2007-11-13 03:59:42.000000000 -0600
+++ 4.6.5.src/components/com_registration/registration.html.php	2008-05-28 07:18:48.000000000 -0500
@@ -1,232 +1,232 @@
-<?php
-/**
-* @package Mambo
-* @subpackage Users
-* @author Mambo Foundation Inc see README.php
-* @copyright Mambo Foundation Inc.
-* See COPYRIGHT.php for copyright notices and details.
-* @license GNU/GPL Version 2, see LICENSE.php
-* Mambo is free software; you can redistribute it and/or
-* modify it under the terms of the GNU General Public License
-* as published by the Free Software Foundation; version 2 of the License.
-*/
-
-/** ensure this file is being included by a parent file */
-defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
-
-class HTML_registration {
-	function lostPassForm($option) {
-		?>
-
-<div class="componentheading">
-	<?php echo T_('Lost your Password?'); ?>
-</div>
-<table cellpadding="0" cellspacing="0" border="0" width="100%" class="contentpane">
-  <form action="index.php" method="post">
-    <tr>
-      <td colspan="2"><?php printf(T_('Please enter your Username and e-mail address then click on the Send Password button.%s You will receive a new password shortly.  Use the new password to access the site.'), '<br />'); ?></td>
-    </tr>
-    <tr>
-      <td><?php echo T_('Username:'); ?></td>
-      <td><input type="text" name="checkusername" class="inputbox" size="40" maxlength="25" /></td>
-    </tr>
-    <tr>
-      <td><?php echo T_('E-mail Address:'); ?></td>
-      <td><input type="text" name="confirmEmail" class="inputbox" size="40" /></td>
-    </tr>
-    <tr>
-      <td colspan="2"> <input type="hidden" name="option" value="<?php echo $option;?>" />
-        <input type="hidden" name="task" value="sendNewPass" /> <input type="submit" class="button" value="<?php echo T_('Send Password'); ?>" /></td>
-    </tr>
-  </form>
-</table>
-<?php
-	}
-
-function registerForm($option, $useractivation) {
-$name = trim( mosGetParam( $_REQUEST, 'name', "" ) );
-$username = trim( mosGetParam( $_REQUEST, 'username', "" ) );
-$email = trim( mosGetParam( $_REQUEST, 'email', "" ) );
-$useractivation = trim( mosGetParam( $_REQUEST, 'useractivation', "" ) );
-?>
-	<script language="javascript" type="text/javascript">
-		function submitbutton() {
-			var form = document.mosForm;
-			//old method didn't really work, just excluded certain characters rather than limiting to a range of characters.
-			//var r = new RegExp("[\<|\>|\"|\'|\%|\;|\(|\)|\&|\+|\-]", "i");
-			var r = new RegExp("[^A-Za-z0-9]", "i");
-
-			// do field validation
-			if (form.name.value == "") {
-				alert( "<?php echo html_entity_decode(T_('Please enter your name.'));?>" );
-				form.name.focus();
-			} else if (form.username.value == "") {
-				alert( "<?php echo html_entity_decode(T_('Please enter a user name.'));?>" );
-				form.username.focus();
-			} else if (r.exec(form.username.value) || form.username.value.length < 3) {
-				alert( "<?php printf( html_entity_decode(T_("Please enter a valid %s.  No spaces, more than %d characters and containing only the characters 0-9,a-z, or A-Z")), html_entity_decode(T_('Please enter a user name.')), 2 );?>" );
-				form.username.focus();
-			} else if (form.email.value == "" ) {
-				alert( "<?php echo html_entity_decode(T_('Please enter a valid e-mail address.'));?>" );
-				form.email.focus();
-			} else if (form.email2.value == "" ) {
-				alert( "<?php echo html_entity_decode(T_('Please enter a valid e-mail address for the verification.'));?>" );
-				form.email2.focus();
-			} else if (form.password.value.length < 6) {
-				alert( "<?php echo html_entity_decode(T_('Please enter a valid password -- more than 6 characters with no spaces and containing only the characters 0-9, a-z, or A-Z'));?>" );
-				form.password.focus();
-			} else if (form.password2.value == "") {
-				alert( "<?php echo html_entity_decode(T_('Please verify the verification password.'));?>" );
-				form.password2.focus();
-			} else if ((form.password.value != "") && (form.password.value != form.password2.value)){
-				alert( "<?php echo html_entity_decode(T_('Password and verification do not match, please try again.'));?>" );
-				form.password.value="";
-				form.password2.value="";
-				form.password.focus();
-			} else if (r.exec(form.password.value)) {
-				alert( "<?php printf( html_entity_decode(T_("Please enter a valid %s.  No spaces, more than %d characters and containing only the characters 0-9,a-z, or A-Z")), html_entity_decode(T_('Password:')), 6 );?>" );
-				form.password.focus();
-			} else if ((form.password.value != "") && (form.email.value != form.email2.value)){
-				alert( "<?php printf( html_entity_decode(T_('Email and verification do not match, please try again.')));?>" );
-				form.email.value="";
-				form.email2.value="";
-				form.email.focus();
-			} else if ( form.accept.checked == false) {
-				alert( "<?php printf( html_entity_decode(T_('You must accept the Privacy Policy and Disclaimer, to continue.')));?>" );
-				form.accept.focus();
-			} else {
-				form.submit();
-			}
-		}
-	</script>
-
-<div class="componentheading">
-	<?php echo T_('Registration'); ?>
-</div>
-<form action="index.php" method="post" name="mosForm">
-<table cellpadding="0" cellspacing="0" border="0" width="100%" class="contentpane">
-<tr>
-<td colspan="2"><?php echo T_('Fields marked with an asterisk (*) are required.'); ?></td>
-</tr>
-    <tr>
-      <td width="30%"><?php echo T_('Name:'); ?> *</td>
-      <td><input type="text" name="name" size="40" value="<?php echo $name; ?>" class="inputbox" /></td>
-    </tr>
-
-    <tr>
-
-      <td><?php echo T_('Username:'); ?> *</td>
-      <td><input type="text" name="username" size="40" value="<?php echo $username; ?>" class="inputbox" /></td>
-    <tr>
-
-      <td><?php echo T_('E-mail:'); ?> *</td>
-      <td><input type="text" name="email" size="40" value="<?php echo $email; ?>" class="inputbox" /></td>
-    </tr>
-
-    <tr>
-      <td><?php echo T_('Verify E-mail:'); ?> *</td>
-      <td><input type="text" name="email2" class="inputbox" id="email2" value="<?php echo $email; ?>" size="40" /></td>
-    </tr>
-    <tr>
-      <td><?php echo T_('Password:'); ?> *</td>
-      <td><input class="inputbox" type="password" name="password" size="40" value="" /></td>
-    </tr>
-    <tr>
-      <td><?php echo T_('Verify Password:'); ?> *</td>
-      <td><input class="inputbox" type="password" name="password2" size="40" value="" /></td>
-    </tr>
-      <td valign="top"><?php echo T_('Disclaimer and<br />Privacy Policy:'); ?> *</td>
-      <td>
-     <textarea name="privacypolicy" cols="48" rows="4" id="privacypolicy" class="inputbox" style="font-size:0.85em;" readonly><?php echo T_('put your disclaimer here..'); ?></textarea>
-     </td>
-    </tr>
-    <tr>
-      <td align="right">&nbsp;</td>
-      <td><input name="accept" type="checkbox" id="accept" value="yes">        
-        <?php echo T_('Yes, I Accept'); ?></td>
-    </tr>
-    <tr>
-      <td colspan="2">&nbsp;</td>
-    </tr>
-
-    <tr>
-      <td colspan=2>
-  </td>
-	</tr>
-</table>
-<input type="hidden" name="id" value="0" />
-<input type="hidden" name="gid" value="0" />
-<input type="hidden" name="useractivation" value="<?php echo $useractivation;?>" />
-<input type="hidden" name="option" value="<?php echo $option; ?>" />
-<input type="hidden" name="task" value="confirmRegistration" />
-<input type="button" value="<?php echo T_('Send Registration'); ?>" class="button" onclick="submitbutton()" />
-</form>
-<?php
-	}
-
-
-function confirmForm($option, $name, $username, $password, $email, $useractivation) {
-?>
-<script language="javascript" type="text/javascript">
-function reviseData()
-{
- var form = document.mosForm;
- form.task.value='reviseRegistration';
- form.submit();
-}
-</script>
-<div class="componentheading">
-<?php echo T_('Registration'); ?></div>
-<form action="index.php" method="post" name="mosForm">
-<table cellpadding="0" cellspacing="0" border="0" width="100%" class="contentpane">
-    <tr>
-      <td colspan="2"><?php echo T_('Please verify that the following data is correct and click the button below to complete registration.'); ?> </td>
-    </tr>
-    <tr>
-      <td colspan="2">&nbsp;</td>
-    </tr>
-    <tr>
-      <td width="15%"><?php echo T_('Name:'); ?> </td>
-      <td><strong><?php echo $name;?></strong><input type="hidden" name="name" size="40" value="<?php echo $name;?>" /></td>
-    </tr>
-    <tr>
-      <td><?php echo T_('Username:'); ?> </td>
-      <td><strong><?php echo $username;?></strong><input type="hidden" name="username" size="40" value="<?php echo $username;?>" /></td>
-    <tr>
-      <td><?php echo T_('E-mail:'); ?> </td>
-      <td><strong><?php echo $email;?></strong><input type="hidden" name="email" size="40" value="<?php echo $email;?>" /></td>
-    </tr>
-    <tr>
-      <td colspan="2">&nbsp;</td>
-    </tr>
-    <tr align="center">
-      <td colspan="2"><table width="80%" border="0" cellspacing="0" cellpadding="0">
-        <tr align="center" valign="top">
-          <td width="45%" align="center" valign="top" style="background-color:#FFE9E6;"><?php echo T_('Go back and correct your data.'); ?></td>
-          <td width="10%" valign="top">&nbsp;</td>
-          <td width="45%" align="center" style="background-color:#E8FFE8"><?php echo T_('The data is correct.'); ?></td>
-        </tr>
-        <tr align="center" valign="middle">
-          <td height="32" align="center" valign="middle" style="background-color:#FFE9E6;"><input name="back" type="button" class="button" id="back" value="<?php echo T_('Correct Your Data'); ?>" onclick="reviseData()"></td>
-          <td>&nbsp;</td>
-          <td align="center" valign="middle" style="background-color:#E8FFE8"><input name="confirm" type="submit" class="button" id="confirm" value="<?php echo T_('Confirm Registration'); ?>"/></td>
-        </tr>
-      </table></td>
-    </tr>
-    <tr>
-      <td colspan=2>
-  </td>
-	</tr>
-</table>
-<input type="hidden" name="id" value="0" />
-<input type="hidden" name="gid" value="0" />
-<input type="hidden" name="useractivation" value="<?php echo $useractivation;?>" />
-<input type="hidden" name="password" value="<?php echo $password;?>" />
-<input type="hidden" name="option" value="<?php echo $option; ?>" />
-<input type="hidden" name="task" value="saveRegistration" />
-</form>
-<?php
-}
-
-}
-?>
+<?php
+/**
+* @package Mambo
+* @subpackage Users
+* @author Mambo Foundation Inc see README.php
+* @copyright Mambo Foundation Inc.
+* See COPYRIGHT.php for copyright notices and details.
+* @license GNU/GPL Version 2, see LICENSE.php
+* Mambo is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; version 2 of the License.
+*/
+
+/** ensure this file is being included by a parent file */
+defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
+
+class HTML_registration {
+	function lostPassForm($option) {
+		?>
+
+<div class="componentheading">
+	<?php echo T_('Lost your Password?'); ?>
+</div>
+<table cellpadding="0" cellspacing="0" border="0" width="100%" class="contentpane">
+  <form action="index.php" method="post">
+    <tr>
+      <td colspan="2"><?php printf(T_('Please enter your Username and e-mail address then click on the Send Password button.%s You will receive a new password shortly.  Use the new password to access the site.'), '<br />'); ?></td>
+    </tr>
+    <tr>
+      <td><?php echo T_('Username:'); ?></td>
+      <td><input type="text" name="checkusername" class="inputbox" size="40" maxlength="25" /></td>
+    </tr>
+    <tr>
+      <td><?php echo T_('E-mail Address:'); ?></td>
+      <td><input type="text" name="confirmEmail" class="inputbox" size="40" /></td>
+    </tr>
+    <tr>
+      <td colspan="2"> <input type="hidden" name="option" value="<?php echo $option;?>" />
+        <input type="hidden" name="task" value="sendNewPass" /> <input type="submit" class="button" value="<?php echo T_('Send Password'); ?>" /></td>
+    </tr>
+  </form>
+</table>
+<?php
+	}
+
+function registerForm($option, $useractivation) {
+$name = trim( mosGetParam( $_REQUEST, 'name', "" ) );
+$username = trim( mosGetParam( $_REQUEST, 'username', "" ) );
+$email = trim( mosGetParam( $_REQUEST, 'email', "" ) );
+$useractivation = trim( mosGetParam( $_REQUEST, 'useractivation', "" ) );
+?>
+	<script language="javascript" type="text/javascript">
+		function submitbutton() {
+			var form = document.mosForm;
+			//old method didn't really work, just excluded certain characters rather than limiting to a range of characters.
+			//var r = new RegExp("[\<|\>|\"|\'|\%|\;|\(|\)|\&|\+|\-]", "i");
+			var r = new RegExp("[^A-Za-z0-9]", "i");
+
+			// do field validation
+			if (form.name.value == "") {
+				alert( "<?php echo html_entity_decode(T_('Please enter your name.'));?>" );
+				form.name.focus();
+			} else if (form.username.value == "") {
+				alert( "<?php echo html_entity_decode(T_('Please enter a user name.'));?>" );
+				form.username.focus();
+			} else if (r.exec(form.username.value) || form.username.value.length < 3) {
+				alert( "<?php printf( html_entity_decode(T_("Please enter a valid %s.  No spaces, more than %d characters and containing only the characters 0-9,a-z, or A-Z")), html_entity_decode(T_('Please enter a user name.')), 2 );?>" );
+				form.username.focus();
+			} else if (form.email.value == "" || !form.email.value.match(/[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}/i)) {
+				alert( "<?php echo html_entity_decode(T_('Please enter a valid e-mail address.'));?>" );
+				form.email.focus();
+			} else if (form.email2.value == "" ) {
+				alert( "<?php echo html_entity_decode(T_('Please enter a valid e-mail address for the verification.'));?>" );
+				form.email2.focus();
+			} else if (form.password.value.length < 6) {
+				alert( "<?php echo html_entity_decode(T_('Please enter a valid password -- more than 6 characters with no spaces and containing only the characters 0-9, a-z, or A-Z'));?>" );
+				form.password.focus();
+			} else if (form.password2.value == "") {
+				alert( "<?php echo html_entity_decode(T_('Please verify the verification password.'));?>" );
+				form.password2.focus();
+			} else if ((form.password.value != "") && (form.password.value != form.password2.value)){
+				alert( "<?php echo html_entity_decode(T_('Password and verification do not match, please try again.'));?>" );
+				form.password.value="";
+				form.password2.value="";
+				form.password.focus();
+			} else if (r.exec(form.password.value)) {
+				alert( "<?php printf( html_entity_decode(T_("Please enter a valid %s.  No spaces, more than %d characters and containing only the characters 0-9,a-z, or A-Z")), html_entity_decode(T_('Password:')), 6 );?>" );
+				form.password.focus();
+			} else if ((form.password.value != "") && (form.email.value != form.email2.value)){
+				alert( "<?php printf( html_entity_decode(T_('Email and verification do not match, please try again.')));?>" );
+				form.email.value="";
+				form.email2.value="";
+				form.email.focus();
+			} else if ( form.accept.checked == false) {
+				alert( "<?php printf( html_entity_decode(T_('You must accept the Privacy Policy and Disclaimer, to continue.')));?>" );
+				form.accept.focus();
+			} else {
+				form.submit();
+			}
+		}
+	</script>
+
+<div class="componentheading">
+	<?php echo T_('Registration'); ?>
+</div>
+<form action="index.php" method="post" name="mosForm">
+<table cellpadding="0" cellspacing="0" border="0" width="100%" class="contentpane">
+<tr>
+<td colspan="2"><?php echo T_('Fields marked with an asterisk (*) are required.'); ?></td>
+</tr>
+    <tr>
+      <td width="30%"><?php echo T_('Name:'); ?> *</td>
+      <td><input type="text" name="name" size="40" value="<?php echo $name; ?>" class="inputbox" /></td>
+    </tr>
+
+    <tr>
+
+      <td><?php echo T_('Username:'); ?> *</td>
+      <td><input type="text" name="username" size="40" value="<?php echo $username; ?>" class="inputbox" /></td>
+    <tr>
+
+      <td><?php echo T_('E-mail:'); ?> *</td>
+      <td><input type="text" name="email" size="40" value="<?php echo $email; ?>" class="inputbox" /></td>
+    </tr>
+
+    <tr>
+      <td><?php echo T_('Verify E-mail:'); ?> *</td>
+      <td><input type="text" name="email2" class="inputbox" id="email2" value="<?php echo $email; ?>" size="40" /></td>
+    </tr>
+    <tr>
+      <td><?php echo T_('Password:'); ?> *</td>
+      <td><input class="inputbox" type="password" name="password" size="40" value="" /></td>
+    </tr>
+    <tr>
+      <td><?php echo T_('Verify Password:'); ?> *</td>
+      <td><input class="inputbox" type="password" name="password2" size="40" value="" /></td>
+    </tr>
+      <td valign="top"><?php echo T_('Disclaimer and<br />Privacy Policy:'); ?> *</td>
+      <td>
+     <textarea name="privacypolicy" cols="48" rows="4" id="privacypolicy" class="inputbox" style="font-size:0.85em;" readonly><?php echo T_('put your disclaimer here..'); ?></textarea>
+     </td>
+    </tr>
+    <tr>
+      <td align="right">&nbsp;</td>
+      <td><input name="accept" type="checkbox" id="accept" value="yes">        
+        <?php echo T_('Yes, I Accept'); ?></td>
+    </tr>
+    <tr>
+      <td colspan="2">&nbsp;</td>
+    </tr>
+
+    <tr>
+      <td colspan=2>
+  </td>
+	</tr>
+</table>
+<input type="hidden" name="id" value="0" />
+<input type="hidden" name="gid" value="0" />
+<input type="hidden" name="useractivation" value="<?php echo $useractivation;?>" />
+<input type="hidden" name="option" value="<?php echo $option; ?>" />
+<input type="hidden" name="task" value="confirmRegistration" />
+<input type="button" value="<?php echo T_('Send Registration'); ?>" class="button" onclick="submitbutton()" />
+</form>
+<?php
+	}
+
+
+function confirmForm($option, $name, $username, $password, $email, $useractivation) {
+?>
+<script language="javascript" type="text/javascript">
+function reviseData()
+{
+ var form = document.mosForm;
+ form.task.value='reviseRegistration';
+ form.submit();
+}
+</script>
+<div class="componentheading">
+<?php echo T_('Registration'); ?></div>
+<form action="index.php" method="post" name="mosForm">
+<table cellpadding="0" cellspacing="0" border="0" width="100%" class="contentpane">
+    <tr>
+      <td colspan="2"><?php echo T_('Please verify that the following data is correct and click the button below to complete registration.'); ?> </td>
+    </tr>
+    <tr>
+      <td colspan="2">&nbsp;</td>
+    </tr>
+    <tr>
+      <td width="15%"><?php echo T_('Name:'); ?> </td>
+      <td><strong><?php echo $name;?></strong><input type="hidden" name="name" size="40" value="<?php echo $name;?>" /></td>
+    </tr>
+    <tr>
+      <td><?php echo T_('Username:'); ?> </td>
+      <td><strong><?php echo $username;?></strong><input type="hidden" name="username" size="40" value="<?php echo $username;?>" /></td>
+    <tr>
+      <td><?php echo T_('E-mail:'); ?> </td>
+      <td><strong><?php echo $email;?></strong><input type="hidden" name="email" size="40" value="<?php echo $email;?>" /></td>
+    </tr>
+    <tr>
+      <td colspan="2">&nbsp;</td>
+    </tr>
+    <tr align="center">
+      <td colspan="2"><table width="80%" border="0" cellspacing="0" cellpadding="0">
+        <tr align="center" valign="top">
+          <td width="45%" align="center" valign="top" style="background-color:#FFE9E6;"><?php echo T_('Go back and correct your data.'); ?></td>
+          <td width="10%" valign="top">&nbsp;</td>
+          <td width="45%" align="center" style="background-color:#E8FFE8"><?php echo T_('The data is correct.'); ?></td>
+        </tr>
+        <tr align="center" valign="middle">
+          <td height="32" align="center" valign="middle" style="background-color:#FFE9E6;"><input name="back" type="button" class="button" id="back" value="<?php echo T_('Correct Your Data'); ?>" onclick="reviseData()"></td>
+          <td>&nbsp;</td>
+          <td align="center" valign="middle" style="background-color:#E8FFE8"><input name="confirm" type="submit" class="button" id="confirm" value="<?php echo T_('Confirm Registration'); ?>"/></td>
+        </tr>
+      </table></td>
+    </tr>
+    <tr>
+      <td colspan=2>
+  </td>
+	</tr>
+</table>
+<input type="hidden" name="id" value="0" />
+<input type="hidden" name="gid" value="0" />
+<input type="hidden" name="useractivation" value="<?php echo $useractivation;?>" />
+<input type="hidden" name="password" value="<?php echo $password;?>" />
+<input type="hidden" name="option" value="<?php echo $option; ?>" />
+<input type="hidden" name="task" value="saveRegistration" />
+</form>
+<?php
+}
+
+}
+?>
diff -x .svn -aruN 4.6.4.src/includes/Cache/Lite/Output.php 4.6.5.src/includes/Cache/Lite/Output.php
--- 4.6.4.src/includes/Cache/Lite/Output.php	2008-03-19 23:13:16.000000000 -0500
+++ 4.6.5.src/includes/Cache/Lite/Output.php	2008-06-16 22:32:00.000000000 -0500
@@ -10,6 +10,7 @@
 * @version $Id: Output.php,v 1.1 2005/07/22 01:57:13 eddieajau Exp $
 * @author Fabien MARTY <fab@php.net>
 */
+defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
 
 require_once($mosConfig_absolute_path . '/includes/Cache/Lite.php');
 
diff -x .svn -aruN 4.6.4.src/includes/core.classes.php 4.6.5.src/includes/core.classes.php
--- 4.6.4.src/includes/core.classes.php	2008-05-19 05:32:14.000000000 -0500
+++ 4.6.5.src/includes/core.classes.php	2008-06-17 06:23:40.000000000 -0500
@@ -1393,7 +1393,7 @@
         $checker = explode(',', $types);
         $result = null;
         foreach ($this->_menus as $menu) {
-            if (in_array($menu->menutype, $checker)) $result[] = $menu;
+            if (in_array($menu->type, $checker)) $result[] = $menu;
         }
         return $result;
     }
@@ -2488,7 +2488,7 @@
             if ($mos_change_template) {
                 // check that template exists in case it was deleted
                 $path = mamboCore::get('mosConfig_absolute_path')."/templates/$mos_change_template/index.php";
-                if (strpos($mos_change_template,'..') == false AND strpos($mos_change_template,':') == false AND file_exists($path)) {
+                if (strpos($mos_change_template,'..') === false AND strpos($mos_change_template,':') === false AND file_exists($path)) {
                     $lifetime = 60*10;
                     $cur_template = $mos_change_template;
                     setcookie( "mos_user_template", "$mos_change_template", time()+$lifetime);
diff -x .svn -aruN 4.6.4.src/includes/frontend.html.php 4.6.5.src/includes/frontend.html.php
--- 4.6.4.src/includes/frontend.html.php	2008-04-21 23:03:10.000000000 -0500
+++ 4.6.5.src/includes/frontend.html.php	2008-06-18 12:33:23.000000000 -0500
@@ -37,10 +37,6 @@
 				echo $module->content;
 			return;
 		} else {
-			if($isBuffered) {
-				echo $module->buffer;
-				return;
-			}
 			?>
 			<table cellpadding="0" cellspacing="0" class="moduletable<?php echo $moduleclass_sfx; ?>">
 			<?php
@@ -58,9 +54,12 @@
 				?>
 				<tr>
 					<td>
-				<?php 
-						echo $module->content;
-				?>
+					<?php 
+					if($isBuffered)
+						echo $module->buffer;
+					else
+						echo $module->content;
+					?>
 					</td>
 				</tr>
 				<?php
diff -x .svn -aruN 4.6.4.src/includes/version.php 4.6.5.src/includes/version.php
--- 4.6.4.src/includes/version.php	2008-05-21 05:58:38.000000000 -0500
+++ 4.6.5.src/includes/version.php	2008-06-18 12:42:25.000000000 -0500
@@ -19,11 +19,11 @@
 	/** @var string Development Status */
 	var $DEV_STATUS = 'Stable';
 	/** @var int Sub Release Level */
-	var $DEV_LEVEL = '4';
+	var $DEV_LEVEL = '5';
 	/** @var string Codename */
-	var $CODENAME = 'Sunrise';
+	var $CODENAME = 'Jupiter';
 	/** @var string Date */
-	var $RELDATE = '21-May-2008';
+	var $RELDATE = '20-Jun-2008';
 	/** @var string Time */
 	var $RELTIME = '00:00';
 	/** @var string Timezone */
diff -x .svn -aruN 4.6.4.src/index.php 4.6.5.src/index.php
--- 4.6.4.src/index.php	2008-05-19 05:35:48.000000000 -0500
+++ 4.6.5.src/index.php	2008-06-17 17:54:02.000000000 -0500
@@ -320,8 +320,12 @@
         else {
             if (!isset($popup)) {
                 $pop = mosGetParam($_REQUEST, 'pop', '');
-                if ($pop) require($configuration->rootPath()."/administrator/popups/$pop");
-                else require($configuration->rootPath()."/administrator/popups/index3pop.php");
+                $pathPopup = $configuration->rootPath()."/administrator/popups/$pop";
+                if (strpos($pop,'..') === false && file_exists($pathPopup) && $pop) {
+                    require($pathPopup);
+                } else {
+                    require($configuration->rootPath()."/administrator/popups/index3pop.php");
+                }
                 $configuration->doGzip();
             }
         }
diff -x .svn -aruN 4.6.4.src/mambots/content/moscomment.xml 4.6.5.src/mambots/content/moscomment.xml
--- 4.6.4.src/mambots/content/moscomment.xml	2008-01-12 01:19:14.000000000 -0600
+++ 4.6.5.src/mambots/content/moscomment.xml	2008-05-23 21:29:22.000000000 -0500
@@ -7,7 +7,7 @@
 	<license>http://www.opensource.org/licenses/gpl-license.php GNU/GPL v.2</license>
 	<authorEmail>core@mambo-foundation.org</authorEmail>
 	<authorUrl>mambo-foundation.org</authorUrl>
-	<version>4.6.x.7</version>
+	<version>1.3</version>
   <description>Adds a commenting feature to articles within selected sections</description>
   <files>
     <filename mambot="moscomment">moscomment.php</filename>
diff -x .svn -aruN 4.6.4.src/modules/mod_latestcontent.xml 4.6.5.src/modules/mod_latestcontent.xml
--- 4.6.4.src/modules/mod_latestcontent.xml	2008-02-27 02:50:16.000000000 -0600
+++ 4.6.5.src/modules/mod_latestcontent.xml	2008-05-23 21:29:22.000000000 -0500
@@ -7,7 +7,7 @@
 	<license>http://www.opensource.org/licenses/gpl-license.php GNU/GPL v.2</license>
 	<authorEmail>core@mambo-foundation.org</authorEmail>
 	<authorUrl>mambo-foundation.org</authorUrl>
-	<version>4.6.x.8</version>
+	<version>1.2</version>
 	<description>This module shows a list of content with intro text in vertical or horizontal of the most recently published Items that are still current (some may have expired even though they are the most recent). Items that are displayed on the Front Page Component are not included in the list.</description>
 	<files>
 		<filename module="mod_latestcontent">mod_latestcontent.php</filename>
diff -x .svn -aruN 4.6.4.src/modules/mod_poll.xml 4.6.5.src/modules/mod_poll.xml
--- 4.6.4.src/modules/mod_poll.xml	2008-03-26 21:00:58.000000000 -0500
+++ 4.6.5.src/modules/mod_poll.xml	2008-05-23 21:29:22.000000000 -0500
@@ -7,7 +7,7 @@
 	<license>http://www.opensource.org/licenses/gpl-license.php GNU/GPL v.2</license>
 	<authorEmail>core@mambo-foundation.org</authorEmail>
 	<authorUrl>mambo-foundation.org</authorUrl>
-	<version>4.6.x.8</version>
+	<version>1.1</version>
 	<description>This module compliments the Polls component. It is used to display the configured polls. The module differs from other modules in as much as the Component supports linking between Menu Items and Polls. This means that the module shows only those Polls, which are configured for a certain Menu Item.</description>
 	<files>
 	<filename module="mod_poll">mod_poll.php</filename>
diff -x .svn -aruN 4.6.4.src/modules/mod_random_image.xml 4.6.5.src/modules/mod_random_image.xml
--- 4.6.4.src/modules/mod_random_image.xml	2008-01-12 01:19:14.000000000 -0600
+++ 4.6.5.src/modules/mod_random_image.xml	2008-05-23 21:29:22.000000000 -0500
@@ -7,7 +7,7 @@
 	<license>http://www.opensource.org/licenses/gpl-license.php GNU/GPL v.2</license>
 	<authorEmail>core@mambo-foundation.org</authorEmail>
 	<authorUrl>mambo-foundation.org</authorUrl>
-	<version>4.6.x.7</version>
+	<version>1.1</version>
 	<description>This module display a random image from your chosen directory</description>
 	<files>
 	<filename module="mod_random_image">mod_random_image.php</filename>
diff -x .svn -aruN 4.6.4.src/modules/mod_templatechooser.xml 4.6.5.src/modules/mod_templatechooser.xml
--- 4.6.4.src/modules/mod_templatechooser.xml	2008-01-12 01:19:14.000000000 -0600
+++ 4.6.5.src/modules/mod_templatechooser.xml	2008-05-23 21:29:22.000000000 -0500
@@ -7,7 +7,7 @@
 	<license>http://www.opensource.org/licenses/gpl-license.php GNU/GPL v.2</license>
 	<authorEmail>core@mambo-foundation.org</authorEmail>
 	<authorUrl>mambo-foundation.org</authorUrl>
-	<version>4.6.x.7</version>
+	<version>1.1</version>
 	<description>The Template Chooser module allows the user (visitor) to change the template on the fly from the front-end via a drop down selection list.</description>
 	<files>
 	<filename module="mod_templatechooser">mod_templatechooser.php</filename>
