diff -aruN --binary 21/administrator/components/com_banners/controllers/banner.php 22/administrator/components/com_banners/controllers/banner.php
--- 21/administrator/components/com_banners/controllers/banner.php	2010-07-18 05:15:44.000000000 +0200
+++ 22/administrator/components/com_banners/controllers/banner.php	2010-11-03 19:12:02.000000000 +0100
@@ -1,6 +1,6 @@
 <?php
 /**
- * @version		$Id: banner.php 18162 2010-07-16 07:00:47Z ian $
+ * @version		$Id: banner.php 19343 2010-11-03 18:12:02Z ian $
  * @package		Joomla
  * @subpackage	Banners
  * @copyright	Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
@@ -80,10 +80,14 @@
 		$where		= count( $where ) ? ' WHERE ' . implode( ' AND ', $where ) : '';
 
 		// sanitize $filter_order
-		if (!in_array($filter_order, array('b.name', 'c.name', 'cc.title', 'b.showBanner', 'b.ordering', 'b.sticky', 'b.impmade', 'b.clicks', 'b.bid'))) {
+		if (!in_array($filter_order, array('b.name', 'c.name', 'cc.title', 'b.showBanner', 'b.ordering', 'b.Sticky', 'b.impmade', 'b.clicks', 'b.bid'))) {
 			$filter_order = 'cc.title';
 		}
 
+		if (!in_array(strtoupper($filter_order_Dir), array('ASC', 'DESC'))) {
+			$filter_order_Dir = '';
+		}
+
 		$orderby	= ' ORDER BY '. $filter_order .' '. $filter_order_Dir .', b.ordering';
 
 		// get the total number of records
diff -aruN --binary 21/administrator/components/com_banners/controllers/client.php 22/administrator/components/com_banners/controllers/client.php
--- 21/administrator/components/com_banners/controllers/client.php	2010-07-18 05:15:44.000000000 +0200
+++ 22/administrator/components/com_banners/controllers/client.php	2010-11-03 19:12:02.000000000 +0100
@@ -1,6 +1,6 @@
 <?php
 /**
- * @version		$Id: client.php 18162 2010-07-16 07:00:47Z ian $
+ * @version		$Id: client.php 19343 2010-11-03 18:12:02Z ian $
  * @package		Joomla
  * @subpackage	Banners
  * @copyright	Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
@@ -64,6 +64,10 @@
 			$filter_order = 'a.name';
 		}
 
+		if (!in_array(strtoupper($filter_order_Dir), array('ASC', 'DESC'))) {
+			$filter_order_Dir = '';
+		}
+
 		$orderby = ' ORDER BY '. $filter_order .' '. $filter_order_Dir .', a.cid';
 
 		// get the total number of records
@@ -218,4 +222,4 @@
 
 		$this->setMessage( JText::sprintf( 'Items removed', $n ) );
 	}
-}
\ No hay ningún carácter de nueva línea al final del fichero
+}
diff -aruN --binary 21/administrator/components/com_categories/admin.categories.php 22/administrator/components/com_categories/admin.categories.php
--- 21/administrator/components/com_categories/admin.categories.php	2010-07-18 05:15:44.000000000 +0200
+++ 22/administrator/components/com_categories/admin.categories.php	2010-11-03 19:12:02.000000000 +0100
@@ -1,6 +1,6 @@
 <?php
 /**
- * @version		$Id: admin.categories.php 18162 2010-07-16 07:00:47Z ian $
+ * @version		$Id: admin.categories.php 19343 2010-11-03 18:12:02Z ian $
  * @package		Joomla
  * @subpackage	Categories
  * @copyright	Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
@@ -134,6 +134,10 @@
 		$filter_order = 'c.ordering';
 	}
 
+	if (!in_array(strtoupper($filter_order_Dir), array('ASC', 'DESC'))) {
+		$filter_order_Dir = '';
+	}
+
 	if (intval($section) <= 0 && $section != 'com_content' && $filter_order == 'section_name') {
 		$filter_order = 'c.ordering';
 	}
@@ -1025,4 +1029,4 @@
 
 	$msg 	= JText::_( 'New ordering saved' );
 	$mainframe->redirect( 'index.php?option=com_categories&section='. $section, $msg );
-}
\ No hay ningún carácter de nueva línea al final del fichero
+}
diff -aruN --binary 21/administrator/components/com_contact/admin.contact.php 22/administrator/components/com_contact/admin.contact.php
--- 21/administrator/components/com_contact/admin.contact.php	2010-07-18 05:15:44.000000000 +0200
+++ 22/administrator/components/com_contact/admin.contact.php	2010-11-03 19:12:02.000000000 +0100
@@ -1,6 +1,6 @@
 <?php
 /**
-* @version		$Id: admin.contact.php 18162 2010-07-16 07:00:47Z ian $
+* @version		$Id: admin.contact.php 19343 2010-11-03 18:12:02Z ian $
 * @package		Joomla
 * @subpackage	Contact
 * @copyright	Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
@@ -136,6 +136,10 @@
 		$filter_order = 'cd.ordering';
 	}
 
+	if (!in_array(strtoupper($filter_order_Dir), array('ASC', 'DESC'))) {
+		$filter_order_Dir = '';
+	}
+
 	$where 		= ( count( $where ) ? ' WHERE ' . implode( ' AND ', $where ) : '' );
 	if ($filter_order == 'cd.ordering'){
 		$orderby 	= ' ORDER BY category, cd.ordering';
diff -aruN --binary 21/administrator/components/com_content/toolbar.content.html.php 22/administrator/components/com_content/toolbar.content.html.php
--- 21/administrator/components/com_content/toolbar.content.html.php	2010-04-23 13:40:10.000000000 +0200
+++ 22/administrator/components/com_content/toolbar.content.html.php	2010-10-21 04:00:28.000000000 +0200
@@ -1,6 +1,6 @@
 <?php
 /**
-* @version		$Id: toolbar.content.html.php 14401 2010-01-26 14:10:00Z louis $
+* @version		$Id: toolbar.content.html.php 19173 2010-10-21 03:00:28Z ian $
 * @package		Joomla
 * @subpackage	Content
 * @copyright	Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
@@ -12,6 +12,9 @@
 * See COPYRIGHT.php for copyright notices and details.
 */
 
+// no direct access
+defined( '_JEXEC' ) or die( 'Restricted access' );
+
 /**
 * @package		Joomla
 * @subpackage	Content
diff -aruN --binary 21/administrator/components/com_frontpage/admin.frontpage.php 22/administrator/components/com_frontpage/admin.frontpage.php
--- 21/administrator/components/com_frontpage/admin.frontpage.php	2010-07-18 05:15:44.000000000 +0200
+++ 22/administrator/components/com_frontpage/admin.frontpage.php	2010-11-03 19:12:02.000000000 +0100
@@ -1,6 +1,6 @@
 <?php
 /**
-* @version		$Id: admin.frontpage.php 18162 2010-07-16 07:00:47Z ian $
+* @version		$Id: admin.frontpage.php 19343 2010-11-03 18:12:02Z ian $
 * @package		Joomla
 * @subpackage	Content
 * @copyright	Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
@@ -137,10 +137,14 @@
 	$where 		= ( count( $where ) ? ' WHERE ' . implode( ' AND ', $where ) : '' );
 
 	// ensure we have a good vale for $filter_order
-	if (!in_array($filter_order, array('c.title', 'c.state', 'fpordering', 'groupname', 'c.id', 'sect_name', 'cc.name', 'author'))) {
+	if (!in_array($filter_order, array('c.title', 'c.state', 'fpordering', 'groupname', 'c.id', 'sect_name', 'cc.name', 'author', 'cc.title'))) {
 		$filter_order = 'fpordering';
 	}
 
+	if (!in_array(strtoupper($filter_order_Dir), array('ASC', 'DESC'))) {
+		$filter_order_Dir = '';
+	}
+
 	$orderby 	= ' ORDER BY '. $filter_order .' '. $filter_order_Dir .', fpordering';
 
 	// get the total number of records
@@ -375,4 +379,4 @@
 
 	$msg 	= JText::_( 'New ordering saved' );
 	$mainframe->redirect( 'index.php?option=com_frontpage', $msg );
-}
\ No hay ningún carácter de nueva línea al final del fichero
+}
diff -aruN --binary 21/administrator/components/com_frontpage/views/frontpage.php 22/administrator/components/com_frontpage/views/frontpage.php
--- 21/administrator/components/com_frontpage/views/frontpage.php	2010-05-28 03:28:54.000000000 +0200
+++ 22/administrator/components/com_frontpage/views/frontpage.php	2010-11-03 19:12:02.000000000 +0100
@@ -1,6 +1,6 @@
 <?php
 /**
-* @version		$Id: frontpage.php 17299 2010-05-27 16:06:54Z ian $
+* @version		$Id: frontpage.php 19343 2010-11-03 18:12:02Z ian $
 * @package		Joomla
 * @subpackage	Content
 * @copyright	Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
@@ -92,7 +92,7 @@
 						<?php echo JHTML::_('grid.sort',   'Section', 'sect_name', @$lists['order_Dir'], @$lists['order'] ); ?>
 					</th>
 					<th width="10%" class="title">
-						<?php echo JHTML::_('grid.sort',   'Category', 'cc.name', @$lists['order_Dir'], @$lists['order'] ); ?>
+						<?php echo JHTML::_('grid.sort',   'Category', 'cc.title', @$lists['order_Dir'], @$lists['order'] ); ?>
 					</th>
 					<th width="10%" class="title">
 						<?php echo JHTML::_('grid.sort',   'Author', 'author', @$lists['order_Dir'], @$lists['order'] ); ?>
diff -aruN --binary 21/administrator/components/com_menus/models/list.php 22/administrator/components/com_menus/models/list.php
--- 21/administrator/components/com_menus/models/list.php	2010-07-18 05:15:44.000000000 +0200
+++ 22/administrator/components/com_menus/models/list.php	2010-11-03 19:12:02.000000000 +0100
@@ -1,6 +1,6 @@
 <?php
 /**
- * @version		$Id: list.php 18162 2010-07-16 07:00:47Z ian $
+ * @version		$Id: list.php 19343 2010-11-03 18:12:02Z ian $
  * @package		Joomla
  * @subpackage	Menus
  * @copyright	Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
@@ -81,6 +81,10 @@
 			$filter_order = 'm.ordering';
 		}
 
+		if (!in_array(strtoupper($filter_order_Dir), array('ASC', 'DESC', ''))) {
+			$filter_order_Dir = 'ASC';
+		}
+
 		// just in case filter_order get's messed up
 		if ($filter_order) {
 			$orderby = ' ORDER BY '.$filter_order .' '. $filter_order_Dir .', m.parent, m.ordering';
diff -aruN --binary 21/administrator/components/com_menus/views/list/view.php 22/administrator/components/com_menus/views/list/view.php
--- 21/administrator/components/com_menus/views/list/view.php	2010-07-18 05:15:44.000000000 +0200
+++ 22/administrator/components/com_menus/views/list/view.php	2010-11-03 19:12:02.000000000 +0100
@@ -1,6 +1,6 @@
 <?php
 /**
- * @version		$Id: view.php 18162 2010-07-16 07:00:47Z ian $
+ * @version		$Id: view.php 19343 2010-11-03 18:12:02Z ian $
  * @package		Joomla
  * @subpackage	Menus
  * @copyright	Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
@@ -178,6 +178,10 @@
 			$filter_order = 'm.ordering';
 		}
 
+		if (!in_array(strtoupper($filter_order_Dir), array('ASC', 'DESC', ''))) {
+			$filter_order_Dir = 'ASC';
+		}
+
 		// level limit filter
 		$lists['levellist'] = JHTML::_('select.integerlist',    1, 20, 1, 'levellimit', 'size="1" onchange="document.adminForm.submit();"', $levellimit );
 
diff -aruN --binary 21/administrator/components/com_messages/admin.messages.php 22/administrator/components/com_messages/admin.messages.php
--- 21/administrator/components/com_messages/admin.messages.php	2010-07-18 05:15:44.000000000 +0200
+++ 22/administrator/components/com_messages/admin.messages.php	2010-11-03 19:12:02.000000000 +0100
@@ -1,6 +1,6 @@
 <?php
 /**
-* @version		$Id: admin.messages.php 18162 2010-07-16 07:00:47Z ian $
+* @version		$Id: admin.messages.php 19343 2010-11-03 18:12:02Z ian $
 * @package		Joomla
 * @subpackage	Messages
 * @copyright	Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
@@ -79,6 +79,14 @@
 	}
 	$search = JString::strtolower($search);
 
+	if (!in_array($filter_order, array('a.date_time', 'a.state', 'a.subject', 'user_from'))) {
+		$filter_order = 'a.date_time';
+	}
+
+	if (!in_array(strtoupper($filter_order_Dir), array('ASC', 'DESC'))) {
+		$filter_order_Dir = 'DESC';
+	}
+
 	$where = array();
 	$where[] = ' a.user_id_to='.(int) $user->get('id');
 
@@ -96,11 +104,6 @@
 
 	$where 		= ( count( $where ) ? ' WHERE ' . implode( ' AND ', $where ) : '' );
 
-	// sanitize $filter_order``
-	if (!in_array($filter_order, array('a.subject', 'a.state', 'user_from', 'a.date_time'))) {
-		$filter_order = 'a.date_time';
-	}
-
 	$orderby 	= ' ORDER BY '. $filter_order .' '. $filter_order_Dir .', a.date_time DESC';
 
 	$query = 'SELECT COUNT(*)'
diff -aruN --binary 21/administrator/components/com_modules/controller.php 22/administrator/components/com_modules/controller.php
--- 21/administrator/components/com_modules/controller.php	2010-07-18 05:15:44.000000000 +0200
+++ 22/administrator/components/com_modules/controller.php	2010-11-03 19:12:02.000000000 +0100
@@ -1,6 +1,6 @@
 <?php
 /**
- * @version		$Id: controller.php 18162 2010-07-16 07:00:47Z ian $
+ * @version		$Id: controller.php 19343 2010-11-03 18:12:02Z ian $
  * @package		Joomla
  * @subpackage	Modules
  * @copyright	Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
@@ -105,6 +105,10 @@
 			$filter_order = 'm.position';
 		}
 
+		if (!in_array(strtoupper($filter_order_Dir), array('ASC', 'DESC', ''))) {
+			$filter_order_Dir = '';
+		}
+
 		$where 		= ' WHERE ' . implode( ' AND ', $where );
 		$join 		= ' ' . implode( ' ', $joins );
 		if ($filter_order == 'm.ordering') {
diff -aruN --binary 21/administrator/components/com_newsfeeds/admin.newsfeeds.php 22/administrator/components/com_newsfeeds/admin.newsfeeds.php
--- 21/administrator/components/com_newsfeeds/admin.newsfeeds.php	2010-07-18 05:15:44.000000000 +0200
+++ 22/administrator/components/com_newsfeeds/admin.newsfeeds.php	2010-11-03 19:12:02.000000000 +0100
@@ -1,6 +1,6 @@
 <?php
 /**
-* @version		$Id: admin.newsfeeds.php 18162 2010-07-16 07:00:47Z ian $
+* @version		$Id: admin.newsfeeds.php 19343 2010-11-03 18:12:02Z ian $
 * @package		Joomla
 * @subpackage	Newsfeeds
 * @copyright	Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
@@ -119,6 +119,10 @@
 		$filter_order = 'a.ordering';
 	}
 
+	if (!in_array(strtoupper($filter_order_Dir), array('ASC', 'DESC'))) {
+		$filter_order_Dir = '';
+	}
+
 	$where 		= ( count( $where ) ? ' WHERE ' . implode( ' AND ', $where ) : '' );
 	if ($filter_order == 'a.ordering'){
 		$orderby 	= ' ORDER BY catname, a.ordering';
diff -aruN --binary 21/administrator/components/com_plugins/views/plugins/view.html.php 22/administrator/components/com_plugins/views/plugins/view.html.php
--- 21/administrator/components/com_plugins/views/plugins/view.html.php	2010-07-18 05:15:44.000000000 +0200
+++ 22/administrator/components/com_plugins/views/plugins/view.html.php	2010-11-03 19:12:02.000000000 +0100
@@ -1,6 +1,6 @@
 <?php
 /**
-* @version		$Id: view.html.php 18162 2010-07-16 07:00:47Z ian $
+* @version		$Id: view.html.php 19343 2010-11-03 18:12:02Z ian $
 * @package		Joomla
 * @subpackage	Config
 * @copyright	Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
@@ -79,6 +79,10 @@
 			$filter_order = 'p.folder';
 		}
 
+		if (!in_array(strtoupper($filter_order_Dir), array('ASC', 'DESC'))) {
+			$filter_order_Dir = '';
+		}
+
 		if ($filter_order == 'p.ordering') {
 			$orderby = ' ORDER BY p.folder, p.ordering '. $filter_order_Dir;
 		} else {
@@ -144,4 +148,4 @@
 
 		parent::display($tpl);
 	}
-}
\ No hay ningún carácter de nueva línea al final del fichero
+}
diff -aruN --binary 21/administrator/components/com_poll/views/polls/view.html.php 22/administrator/components/com_poll/views/polls/view.html.php
--- 21/administrator/components/com_poll/views/polls/view.html.php	2010-07-18 05:15:44.000000000 +0200
+++ 22/administrator/components/com_poll/views/polls/view.html.php	2010-11-03 19:12:02.000000000 +0100
@@ -1,6 +1,6 @@
 <?php
 /**
-* @version		$Id: view.html.php 18162 2010-07-16 07:00:47Z ian $
+* @version		$Id: view.html.php 19343 2010-11-03 18:12:02Z ian $
 * @package		Joomla
 * @subpackage	Config
 * @copyright	Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
@@ -69,6 +69,10 @@
 			$filter_order = 'm.id';
 		}
 
+		if (!in_array(strtoupper($filter_order_Dir), array('ASC', 'DESC'))) {
+			$filter_order_Dir = '';
+		}
+
 		$orderby 	= ' ORDER BY '. $filter_order .' '. $filter_order_Dir;
 
 		$query = 'SELECT COUNT(m.id)'
@@ -115,4 +119,4 @@
 
 		parent::display($tpl);
 	}
-}
\ No hay ningún carácter de nueva línea al final del fichero
+}
diff -aruN --binary 21/administrator/components/com_search/models/search.php 22/administrator/components/com_search/models/search.php
--- 21/administrator/components/com_search/models/search.php	2010-07-18 05:15:44.000000000 +0200
+++ 22/administrator/components/com_search/models/search.php	2010-11-03 19:12:02.000000000 +0100
@@ -1,6 +1,6 @@
 <?php
 /**
- * @version		$Id: search.php 18162 2010-07-16 07:00:47Z ian $
+ * @version		$Id: search.php 19343 2010-11-03 18:12:02Z ian $
  * @package		Joomla
  * @subpackage	Search
  * @copyright	Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
@@ -63,8 +63,12 @@
 			$filter_order = 'hits';
 		}
 
+		if (!in_array(strtoupper($filter_order_Dir), array('ASC', 'DESC'))) {
+			$filter_order_Dir = '';
+		}
+
 		// table ordering
-		if ( $filter_order_Dir == 'ASC' ) {
+		if ( strtoupper($filter_order_Dir) == 'ASC' ) {
 			$this->lists['order_Dir'] = 'ASC';
 		} else {
 			$this->lists['order_Dir'] = 'DESC';
@@ -128,4 +132,4 @@
 
 		return $rows;
 	}
-}
\ No hay ningún carácter de nueva línea al final del fichero
+}
diff -aruN --binary 21/administrator/components/com_sections/admin.sections.php 22/administrator/components/com_sections/admin.sections.php
--- 21/administrator/components/com_sections/admin.sections.php	2010-07-18 05:15:44.000000000 +0200
+++ 22/administrator/components/com_sections/admin.sections.php	2010-11-03 19:12:02.000000000 +0100
@@ -1,6 +1,6 @@
 <?php
 /**
-* @version		$Id: admin.sections.php 18162 2010-07-16 07:00:47Z ian $
+* @version		$Id: admin.sections.php 19343 2010-11-03 18:12:02Z ian $
 * @package		Joomla
 * @subpackage	Sections
 * @copyright	Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
@@ -138,6 +138,10 @@
 		$filter_order = 's.ordering';
 	}
 
+	if (!in_array(strtoupper($filter_order_Dir), array('ASC', 'DESC'))) {
+		$filter_order_Dir = '';
+	}
+
 	$orderby 	= ' ORDER BY '.$filter_order.' '. $filter_order_Dir .', s.ordering';
 
 	// get the total number of records
@@ -725,4 +729,4 @@
 
 	$msg 	= JText::_( 'New ordering saved' );
 	$mainframe->redirect( 'index.php?option=com_sections&scope=content', $msg );
-}
\ No hay ningún carácter de nueva línea al final del fichero
+}
diff -aruN --binary 21/administrator/components/com_translationsmanager/controller.php 22/administrator/components/com_translationsmanager/controller.php
--- 21/administrator/components/com_translationsmanager/controller.php	2010-06-09 14:27:44.000000000 +0200
+++ 22/administrator/components/com_translationsmanager/controller.php	2010-10-28 04:32:22.000000000 +0200
@@ -204,11 +204,11 @@
 		}
 
 		// set the filename
-		$options['filename'] = $options['cid'][0];
-
-
-jimport('joomla.filesystem.file');
-$options['filename'] = JFile::makeSafe($options['filename']);
+		$options['filename'] = $options['cid'][0];
+
+
+jimport('joomla.filesystem.file');
+$options['filename'] = JFile::makeSafe($options['filename']);
 
 
 		// build the autocorrect array
@@ -292,7 +292,7 @@
 				// get the language and language path
 				$lang = substr($file,0,$options['langLen']);
 				$langPath = JLanguage::getLanguagePath( $options['basePath'], $lang );
-				$langPath = JPath::clean($langPath );
+				$langPath = JPath::clean($langPath );
 
 				// ensure that XML files are only affected by XML tasks
 				if ( (substr($file,-4)=='.xml') && (substr($task,-3)!='xml') ) {
@@ -598,14 +598,14 @@
 				$editMeta['complete'] = ( $editMeta['complete'] == 'COMPLETE' ) ? $editMeta['unchanged'] : 0;
 				// build the header
 				if ($editMeta['headertype']==1) {
-					$saveContent = '# $Id: ' . $options['filename'] . ' ' . $editMeta['version'] . ' ' . date('Y-m-d H:i:s') . ' ' . $editMeta['owner'] . ' ~' . $editMeta['complete'] . ' $';
+					$saveContent = '; $Id: ' . $options['filename'] . ' ' . $editMeta['version'] . ' ' . date('Y-m-d H:i:s') . ' ' . $editMeta['owner'] . ' ~' . $editMeta['complete'] . ' $';
 				} else {
-					$saveContent = '# version ' . $editMeta['version'] . ' ' . date('Y-m-d H:i:s') . ' ~' . $editMeta['complete'];
+					$saveContent = '; version ' . $editMeta['version'] . ' ' . date('Y-m-d H:i:s') . ' ~' . $editMeta['complete'];
 				}
-				$saveContent .= "\n" . '# author ' . $editMeta['author'];
-				$saveContent .= "\n" . '# copyright ' . $editMeta['copyright'];
-				$saveContent .= "\n" . '# license ' . $editMeta['license'];
-				$saveContent .= "\n\n" .  '# Note : All ini files need to be saved as UTF-8';
+				$saveContent .= "\n" . '; author ' . $editMeta['author'];
+				$saveContent .= "\n" . '; copyright ' . $editMeta['copyright'];
+				$saveContent .= "\n" . '; license ' . $editMeta['license'];
+				$saveContent .= "\n\n" .  '; Note : All ini files need to be saved as UTF-8';
 				$saveContent .= "\n\n";
 
 				// process the $editData array to get the remaining content
@@ -1536,4 +1536,4 @@
 	}
 
 }
-?>
+?>
diff -aruN --binary 21/administrator/components/com_translationsmanager/controller.php.bak 22/administrator/components/com_translationsmanager/controller.php.bak
--- 21/administrator/components/com_translationsmanager/controller.php.bak	1970-01-01 01:00:00.000000000 +0100
+++ 22/administrator/components/com_translationsmanager/controller.php.bak	2010-06-09 13:27:44.000000000 +0200
@@ -0,0 +1,1539 @@
+<?php
+/**
+* @version 1.5
+* @package com_translationsmanager
+* @author Ifan Evans
+* @copyright Copyright (C) 2007 Ifan Evans. All rights reserved.
+* @license GNU/GPL
+* @bugs - please report to post@ffenest.co.uk
+*/
+
+// Check to ensure this file is included in Joomla!
+defined('_JEXEC') or die();
+
+// import controller parent class
+jimport( 'joomla.application.component.controller' );
+
+/**
+* Controller class for the translationsmanager component
+*/
+class TranslationsController extends JController
+{
+	/**
+	 * Custom Constructor
+	 */
+	function __construct( $default = array() )
+	{
+		parent::__construct( $default );
+
+		$this->registerTask( 'cancel', 		'doTask' );
+		$this->registerTask( 'cancelxml', 	'doTask' );
+		$this->registerTask( 'checkin', 	'doTask' );
+		$this->registerTask( 'checkout', 	'doTask' );
+		$this->registerTask( 'publish', 	'doTask' );
+		$this->registerTask( 'remove', 		'doTask' );
+		$this->registerTask( 'removexml', 	'doTask' );
+		$this->registerTask( 'unpublish', 	'doTask' );
+
+		$this->registerTask( 'add', 		'edit' );
+		$this->registerTask( 'apply', 		'edit' );
+		$this->registerTask( 'save', 		'edit' );
+
+		$this->registerTask( 'addxml', 		'editXML' );
+		$this->registerTask( 'applyxml', 	'editXML' );
+		$this->registerTask( 'editxml', 	'editXML' );
+		$this->registerTask( 'savexml', 	'editXML' );
+
+		$this->registerTask( 'default', 	'setDefault' );
+
+	}
+
+	/**
+	* Build the filters for a view
+	* @param array an associative array of allowed fields and values
+	* @param string the namespace for this view
+	* @return array	The Configuration in an array
+	*/
+	function _buildfilters( $allowed=array(), $namespace='' )
+	{
+		// initialise
+		global $mainframe;
+		$filters = array();
+		if ($namespace) {
+			$namespace = trim($namespace,'.') . '.';
+		} else {
+			$namespace = 'com_translationsmanager.';
+		}
+
+		// get the limitstart for this namespace
+		$filters['limitstart'] = $mainframe->getUserStateFromRequest( $namespace . 'limitstart', 'limitstart', 0 );
+
+		// then validate all the filters for this namespace
+		foreach ($allowed as $k=>$v) {
+			// values are all changed to lower case
+			$values = explode('|',$v);
+			foreach ( $values as $k2=>$v2 ) {
+				$values[$k2] = strtolower($v2);
+			}
+			// A: get the old/current value
+			$old = $mainframe->getUserState( 'request.' . $namespace . $k );
+			// B: get the new value from the user input
+			$new = $mainframe->getUserStateFromRequest( $namespace . $k, $k, $values[0] );
+			// C: check that the new (lowercase) value is valid
+			if ($k=='limit') {
+				$new = (is_numeric($new)) ? abs($new) : $values[0];
+			} else if ( $v && array_search(strtolower($new),$values) === false ) {
+				$new = $values[0];
+			}
+			// D: reset the page to #1 if the value has changed
+			if ( $old != $new ) {
+				$options['limitstart'] = 0;
+			}
+			// set the value
+			$filters[$k] = $new;
+		}
+
+		// return
+		return $filters;
+	}
+
+	/**
+	* Build the configuration options.
+	* @return array	The Configuration in an array
+	*/
+	function _buildoptions ()
+	{
+		// initialise configuration variables
+		global $mainframe;
+		$task	= strtolower($this->_task);
+		$options['config'] 			= JComponentHelper::getParams( 'com_translationsmanager' );
+
+		$options['autoCorrect']		= $options['config']->get( 'autoCorrect', 'a^=â' );
+		$options['backticks'] 		= $options['config']->get( 'backticks', 0 );
+		$options['cid'] 			= JRequest::getVar( 'cid', array(''), '', 'array' );
+		$options['client_lang']		= $mainframe->getUserStateFromRequest('com_translationsmanager.client_lang','client_lang','');
+		$options['globalChanges'] 	= $options['config']->get('globalChanges', 0 );
+		$options['limitstart']		= $mainframe->getUserStateFromRequest('com_translationsmanager.limitstart','limitstart','');
+		$options['newprocess'] 		= JRequest::getVar('newprocess',0,'','integer' );
+		$options['refLang'] 		= $options['config']->get( 'refLanguage', 'en-GB' );
+		$options['refLangMissing'] 	= false;
+		$options['searchStyle']		= $options['config']->get( 'searchStyle', 'background-color:yellow;' );
+		$options['task'] 			= strtolower($task);
+
+		// initialise a list of available languages
+		$options['languages'] = array();
+		$options['clients'] = array();
+		$options['clients']['S'] = JText::_('Site');
+		foreach (JLanguage::getKnownLanguages(JPATH_SITE) as $k=>$v) {
+			$options['languages']['S_'.$k] = $options['clients']['S'] . ' - '.$v['name'];
+		}
+		$options['clients']['A'] = JText::_('Administrator');
+		foreach (JLanguage::getKnownLanguages(JPATH_ADMINISTRATOR) as $k=>$v) {
+			$options['languages']['A_'.$k] = $options['clients']['A'] . ' - '.$v['name'];
+		}
+		if (JFolder::exists(JPATH_INSTALLATION)) {
+			$options['clients']['I'] = JText::_('Installation');
+			foreach (JLanguage::getKnownLanguages(JPATH_INSTALLATION) as $k=>$v) {
+				$options['languages']['I_'.$k] = $options['clients']['I'] . ' - '.$v['name'];
+			}
+		}
+
+		// validate client_lang (split, reassemble with cases, check against allowed values, on failure default to first allowed value)
+		$cl_split = preg_split("/[^a-z]/i",$options['client_lang']);
+		$options['client_lang'] = strtoupper($cl_split[0]) . '_' . strtolower($cl_split[1]) . '-' . strtoupper($cl_split[2]);
+		if (!isset($options['languages'][$options['client_lang']])) {
+            $options['client_lang'] = key($options['languages']);
+        }
+
+		// set client variables
+		$options['client'] = $options['client_lang']{0};
+		if ($options['client']=='A') {
+			$options['basePath'] = JPATH_ADMINISTRATOR;
+			$options['clientKey'] = 'administrator';
+		} else if ($options['client']=='I') {
+			$options['basePath'] = JPATH_INSTALLATION;
+			$options['clientKey'] = 'installation';
+		} else {
+			$options['basePath'] = JPATH_SITE;
+			$options['clientKey'] = 'site';
+		}
+		$options['clientName'] = JText::_( $options['clientKey'] );
+
+		// validate that the reference language exists on this client
+		if (!isset($options['languages'][$options['client'].'_'.$options['refLang']])) {
+			// initialise to en-GB
+			$use = 'en-GB';
+			// look for the first key index containing the reference language string
+			foreach($options['languages'] as $k=>$v) {
+				if ($k{0}==$options['client']) {
+					$use = substr($k,-4);
+					break;
+				}
+			}
+			// set back to $options key
+			$options['refLang'] = $use;
+		}
+
+		// set language variables
+		$options['lang'] = substr($options['client_lang'],2);
+        $options['langLen'] = strlen($options['lang']);
+		$options['langName'] = $options['languages'][$options['client_lang']];
+		$options['langPath'] 	= JLanguage::getLanguagePath( $options['basePath'], $options['lang'] );
+        $options['refLangLen'] = strlen($options['refLang']);
+		$options['refLangPath'] = JLanguage::getLanguagePath( $options['basePath'], $options['refLang'] );
+
+		// set reference language variables
+		$options['isReference'] = intval( $options['lang']==$options['refLang'] );
+
+		// validate the cid array
+		if ( !is_array( $options['cid'] )) {
+			if (!empty($options['cid'])) $options['cid'] = array($options['cid']);
+			else $options['cid'] = array('');
+		}
+
+		// process the cid array to validate filenames
+		foreach($options['cid'] as $k=>$v ){
+			if ($v) {
+				// strip unpublished prefix
+				if (substr($v,0,3)=='xx.') $v = substr($v,3);
+				// strip files that don't match the selected language
+				if (substr($v,0,$options['langLen'])!=$options['lang']) unset($options['cid'][$k]);
+				// otherwise set back to $options
+				else $options['cid'][$k] = $v;
+			}
+		}
+
+		// set the filename
+		$options['filename'] = $options['cid'][0];
+
+
+jimport('joomla.filesystem.file');
+$options['filename'] = JFile::makeSafe($options['filename']);
+
+
+		// build the autocorrect array
+		$autoCorrect = array();
+		if ($options['autoCorrect']) {
+			foreach(explode(';',$options['autoCorrect']) as $v){
+				list($k2,$v2)=explode('=',$v);
+				$k2 = trim($k2);
+				$v2 = trim($v2);
+				if(($k2)&&($v2)) {
+					$autoCorrect[$k2] = $v2;
+				}
+			}
+		}
+		$options['autoCorrect'] = $autoCorrect;
+
+		// return the options array
+		return $options;
+	}
+
+	/**
+	* Processing File(s)
+	* @param array $options		The configuration array for the component
+	* @param string $task  		a specific task (overrides $options)
+	* @param mixed $file  		a specific filename or array of filenames to process (overrides $options)
+	* @param string $redirect_task	the task to use when redirecting (blank means no redirection)
+	* @param boolean $report	whether or not to report processing success/failure
+	*/
+	function _multitask( $task=null, $file=null, $redirect_task='files', $report=true )
+	{
+		// variables
+		$options =& $this->getOptions();
+		$task = strtolower( is_null($task) ? $this->_task : $task );
+
+		// validate the task
+		if ($task=='cancel') {
+			$task = 'checkin';
+			$redirect_task = 'files';
+			$report = false;
+		} else if ($task=='cancelxml') {
+			$task = 'checkin';
+			$redirect_task = 'languages';
+			$report = false;
+		}
+
+		// validate the filename
+		// 1: use a specific file or files
+		// 2: use the client_lang
+		// 3: check that we have at least one file
+		if ($file) {
+			$options['cid'] = (is_array($file)) ? $file : array($file);
+		} else if ($task=='removexml') {
+			$options['cid'][0] = $options['lang'].'.xml';
+		} else if ( (empty($options['cid'][0])) && ($task!='checkin') ) {
+			echo "<script> alert('". JText::_('Please make a selection from the list to') . ' ' . JText::_(str_replace('xml','',$task)) ."'); window.history.go(-1);</script>\n";
+			exit();
+		}
+
+		// initialise file classes
+		jimport('joomla.filesystem.file');
+
+		// initialise checkout file content
+		if ($task=='checkout') {
+			$user = & JFactory::getUser();
+			$chk_file_content = time() . '#' . $user->get('id','0') . '#' . $user->get('name','[ Unknown User ]');
+		}
+
+		// initialise variables
+		global $mainframe;
+		$file_list = array();
+		$nofile_list = array();
+		$inifile_list = array();
+		$last = '';
+
+		// process each passed file name (always the 'real' filename)
+		foreach ($options['cid'] as $file) {
+
+			// validate the filename language prefix
+			if ( preg_match('/^[a-z]{2,3}-[A-Z]{2}[.].*/',$file) ) {
+
+				// get the language and language path
+				$lang = substr($file,0,$options['langLen']);
+				$langPath = JLanguage::getLanguagePath( $options['basePath'], $lang );
+				$langPath = JPath::clean($langPath );
+
+				// ensure that XML files are only affected by XML tasks
+				if ( (substr($file,-4)=='.xml') && (substr($task,-3)!='xml') ) {
+					// continue without error warning
+					continue;
+				}
+
+				// ensure that there are no existing published INI files when we are deleting an XML file
+				if ( ($task=='removexml') && (count( JFolder::files($langPath,'^'.$lang.'.*ini$') ) ) ) {
+					// error and continue
+					$inifile_list[$file] = $file;
+					continue;
+				};
+
+				// get file path-names
+				$chk_file = JFile::makeSafe('chk.'.$file);
+				$pub_file = JFile::makeSafe($file);
+				$unpub_file = JFile::makeSafe('xx.'.$file);
+
+				// check for an unpublished file
+				if (JFile::exists($langPath.DS.$unpub_file)) {
+					$file = $unpub_file;
+				}
+				// check the file exists
+				else if (!JFile::exists($langPath.DS.$file)) {
+					// error and continue
+					$nofile_list[$file] = $file;
+					continue;
+				}
+
+				// cancel/checkin a file
+				// checkout a file
+				// delete a file
+				// delete an XML file
+				// publish a file
+				// unpublish a file
+				// otherwise break because the task isn't recognised
+				if ( ($task=='checkin') && (JFile::exists($langPath.DS.$chk_file)) ) {
+					$do = JFile::delete( $langPath.DS.$chk_file );
+				} else if ($task=='checkout') {
+					$do = Jfile::write( $langPath.DS.$chk_file, $chk_file_content );
+				} else if ($task=='remove') {
+					$do = JFile::delete( $langPath.DS.$file );
+				} else if ($task=='removexml') {
+					if ( $do = JFile::delete( $langPath.DS.$file ) ) {
+						$do = JFolder::delete( $langPath );
+					}
+				} else if ($task=='publish') {
+					$do = JFile::move( $file, $pub_file, $langPath );
+				} else if ($task=='unpublish') {
+					$do = JFile::move( $file, $unpub_file, $langPath );
+				} else {
+					break;
+				}
+
+				// build an array of things to hide form the filename
+				$filename_hide = array();
+
+				// add the function to the file list on success
+				if ($do) {
+					$file_list[$file] = str_replace( 'xx.'.$lang, $lang,substr($file,0,-4) );
+				}
+			}
+		}
+
+		if ($report) {
+			// report processing success
+			if (count($file_list)) {
+				$mainframe->enqueueMessage(sprintf(JText::_($task.' success'), count($file_list), implode(', ',$file_list) ) );
+			}
+			// report existing ini files
+			if (count($inifile_list)) {
+				$mainframe->enqueueMessage(sprintf(JText::_($task.' inifile'), count($inifile_list), implode(', ',$inifile_list) ) );
+			}
+		}
+
+		// redirect
+		if ($redirect_task) {
+			if ($task=='removexml') {
+				$mainframe->redirect( 'index.php?option=com_translationsmanager' );
+			} else {
+				$mainframe->redirect( 'index.php?option=com_translationsmanager&client_lang='.$options['client_lang'].'&task='.$redirect_task );
+			}
+		}
+	}
+
+	/**
+	* Do various tasks
+	* @uses _multitask
+	*/
+	function doTask()
+	{
+		return $this->_multitask();
+	}
+
+	/**
+	* Create Edit or Save a Translation File
+	*/
+	function edit()
+	{
+		// import file functions
+		jimport('joomla.filesystem.file');
+
+		// variables
+		global $mainframe;
+		$options =& $this->getOptions();
+
+		// build the search highlight array
+		$options['filter_search'] =	$mainframe->getUserStateFromRequest( 'com_translationsmanager.files.filter_search',	'filter_search', '' );
+
+		// we are creating a new file
+		// always in the reference language
+		if ($options['task']=='add') {
+			$options['newprocess'] = 1;
+			if (! $options['isReference'] ) {
+				$mainframe->enqueueMessage( JText::_('Always create in reference language') );
+			}
+		}
+
+		// we are in the process of creating a new file
+		// the filename is set by the 'newfilename' field
+		if ( $options['newprocess'] ) {
+			$options['newfilename'] = JFile::makeSafe(strtolower(JRequest::getVar('newfilename','','','string')));
+			// validate the filename
+			if ($options['newfilename']) {
+				// strip off ini
+				if (substr($options['newfilename'],-4)=='.ini') {
+					$options['newfilename'] = substr($options['newfilename'],0,-4);
+				}
+				// strip off language
+				if (preg_match('/^[a-z]{2}-[a-z]{2}[.].*/',$options['newfilename'])) {
+					$options['newfilename'] = substr($options['newfilename'],6);
+				}
+				// set variables
+				$options['filename'] = JFile::makeSafe($options['lang'].'.'.$options['newfilename'].'.ini');
+			}
+			// no filename
+			else {
+				// report error
+				$mainframe->enqueueMessage( JText::_('filename desc') );
+				// change task
+				if ($options['task']!='add') {
+					$options['task'] = 'edit';
+					$options['field_error_list']['filename'] = JText::_('filename');
+
+				}
+			}
+		}
+
+		// 2: otherwise verify that we have a filename
+		// 3: otherwise validate the checkout status of the selected file
+		else if (empty($options['filename'])) {
+			$mainframe->enqueueMessage( JText::_('You must select a file to edit') );
+			$mainframe->redirect( 'index.php?option=com_translationsmanager&task=files' );
+		} else if ( $content = @file_get_contents(JFile::makeSafe($options['langPath'].DS.'chk.'.$options['filename']))) {
+			list ($timestamp,$userid,$username) = explode( '#', $content.'##' );
+			$user = & JFactory::getUser();
+			// validate the checkout
+			if	(
+				( (time()-$timestamp) < 3600 )
+			&&	( $userid <> 0 )
+			&&	( $userid <> $user->get('id','0') )
+				) {
+				// report and redirect
+				$checkin = '<a href="index.php?option=com_translationsmanager&task=checkin&id='. JFile::makeSafe($options['filename']) .'" title="'. JText::_( 'Force Checkin' ) . '" style="font-size:smaller">[' . JText::_( 'Checkin' ) . ']</a>';
+				$mainframe->enqueueMessage(sprintf(JText::_('checked out by'), $options['filename'], $username, $checkin ) );
+				$mainframe->redirect( 'index.php?option=com_translationsmanager&task=files' );
+			}
+		}
+
+		// set the reference language filename from the selected filename
+		$options['refFilename'] = str_replace($options['lang'],$options['refLang'],$options['filename']);
+
+		// find the published reference language file
+		// default to an unpublished reference file
+		if ( JFile::exists($options['refLangPath'].DS.$options['refFilename']) ) {
+			$options['ref_path_file'] = $options['refLangPath'].DS.$options['refFilename'];
+		} else {
+			$options['ref_path_file'] = $options['refLangPath'].DS.'xx.'.$options['refFilename'];
+		}
+
+		// find the published selected language file
+		// default to an unpublished new file
+		if ( JFile::exists($options['langPath'].DS.$options['filename']) ) {
+			$options['path_file'] = $options['langPath'].DS.$options['filename'];
+		} else {
+			$options['path_file'] = $options['langPath'].DS.'xx.'.$options['filename'];
+		}
+
+		// STRINGS: initialise $editData from the reference language file contents
+		// $editData is an analogue of the reference file
+		// header lines are skipped
+		// comments and blank lines are strings with an integer index
+		// key=value pairs are arrays with the key as an index
+		$editData = array();
+		$header = 0;
+		$refStrings = array();
+		if ( $refContent = @file($options['ref_path_file']) ) {
+			foreach ($refContent as $k=>$v) {
+				$v = trim($v);
+				// grab the comments (but skip up to 6 lines before we have any strings in the file)
+				// grab the strings
+				if ( (empty($v))||($v{0}=='#')||($v{0}==';') ) {
+					if($header++>6) $editData[$k] = $v;
+				} else if(strpos($v,'=')) {
+					$header = 7;
+					list($key,$value) = explode('=',$v,2);
+					$key = strtoupper($key);
+					$refStrings[$key] = $value;
+					$editData[$key] = array('ref'=>$value,'edit'=>$value);
+					if ($options['isReference']) {
+						$editData[$key]['lang_file'] = $value;
+					}
+				}
+			}
+		}
+
+		// STRINGS: load the selected file contents and process into $editData
+		// only when the selected language is not the same as the reference language
+		if ($options['isReference']) {
+			$fileContent = $refContent;
+			$fileStrings = array();
+			$fileMeta = TranslationsHelper::getINIMeta( $fileContent, $fileStrings );
+			$editStrings = $fileStrings;
+		} else if ( $fileContent = @file($options['path_file']) )  {
+			$fileStrings = array();
+			$fileMeta = TranslationsHelper::getINIMeta( $fileContent, $fileStrings );
+			$editStrings = $fileStrings;
+			foreach ( $fileStrings as $k=>$v ) {
+				$editData[$k]['edit'] = $v;
+				$editData[$k]['lang_file'] = $v;
+			}
+		} else {
+			$fileContent = array();
+			$fileStrings = array();
+			$fileMeta = array( 'headertype'=>1, 'owner'=>'ff', 'complete'=>0 );
+			$editStrings = array();
+		}
+
+		// STRINGS: load the user form contents and process into $editData
+		$editFormOnly = array();
+		if ($FormKeys = JRequest::getVar( 'ffKeys', array(), '', 'ARRAY', JREQUEST_ALLOWRAW )) {
+			$FormValues = JRequest::getVar( 'ffValues', array(), '', 'ARRAY', JREQUEST_ALLOWRAW );
+			// process each key=value pair from the form into $editData
+			foreach ($FormKeys as $k=>$v) {
+				if ( ($v) && (isset($FormValues[$k])) ) {
+					$key = strtoupper(trim(stripslashes($v)));
+					$value = trim(stripslashes(str_replace('\n',"\n",$FormValues[$k])));
+					$editStrings[$key] = $value;
+					$editData[$key]['edit'] = $value;
+					$editData[$key]['user_form'] = $value;
+				}
+			}
+			// every element of $editData must have a form entry
+			foreach($editData as $k=>$v){
+				if ( is_array($v) && !isset($v['user_form']) ) {
+					unset($editStrings[$k]);
+					unset($editData[$k]);
+				}
+			}
+		}
+
+		// META: get the XML and status meta then initialise
+		$options['XMLmeta'] = TranslationsHelper::getXMLMeta($options['langPath'].DS.$options['lang'].'.xml');
+		$statusMeta = TranslationsHelper::getINIstatus( $refStrings, $editStrings );
+		$editMeta = array_merge( $options['XMLmeta'], $fileMeta, $statusMeta );
+		$editMeta['filename'] = JFile::makeSafe($options['filename']);
+
+		// META: apply any user form values
+		foreach($editMeta as $k=>$v) {
+			$editMeta[$k] = JRequest::getVar($k,$v,'','string');
+		}
+
+		// META: require meta values
+		foreach(array('version','author') as $v) {
+			if(empty($editMeta[$v])) {
+				$options['field_error_list'][$v] = JText::_($v);
+			}
+		}
+
+		// ERRORS: report any errors and change the task
+		if ((!empty($options['field_error_list']))&&($options['task']!='add')) {
+			$mainframe->enqueueMessage( sprintf( JText::_('Values Required'), implode(', ',$options['field_error_list']) ) );
+			$options['task'] = 'edit';
+		}
+
+		// create a new file or save an existing file
+		if (($options['task']=='apply')||($options['task']=='save')) {
+
+			// ensure the file does not already exist when we are creating a new file
+			if ( ($options['newprocess'])&&(JFile::exists($options['path_file'])) ) {
+				// report error and set task flag
+				$mainframe->enqueueMessage( sprintf(JText::_('Language INI Exists'),$options['newfilename']) );
+				$options['task'] = 'edit';
+			}
+
+			// otherwise save the file
+			else {
+				// check the complete status
+				// we set the complete value to the number of strings that are 'unchanged'
+				// so that if the reference INI file should change the 'complete' flag is unset/broken
+				$editMeta['complete'] = JRequest::getVar( 'complete', '', 'post', 'string' );
+				$editMeta['complete'] = ( $editMeta['complete'] == 'COMPLETE' ) ? $editMeta['unchanged'] : 0;
+				// build the header
+				if ($editMeta['headertype']==1) {
+					$saveContent = '# $Id: ' . $options['filename'] . ' ' . $editMeta['version'] . ' ' . date('Y-m-d H:i:s') . ' ' . $editMeta['owner'] . ' ~' . $editMeta['complete'] . ' $';
+				} else {
+					$saveContent = '# version ' . $editMeta['version'] . ' ' . date('Y-m-d H:i:s') . ' ~' . $editMeta['complete'];
+				}
+				$saveContent .= "\n" . '# author ' . $editMeta['author'];
+				$saveContent .= "\n" . '# copyright ' . $editMeta['copyright'];
+				$saveContent .= "\n" . '# license ' . $editMeta['license'];
+				$saveContent .= "\n\n" .  '# Note : All ini files need to be saved as UTF-8';
+				$saveContent .= "\n\n";
+
+				// process the $editData array to get the remaining content
+				$changedStrings = array();
+				$header = 0;
+				foreach ($editData as $k=>$v) {
+					// 1: add a blank line or comment
+					// 2: add a key=value line (no need to addslashes on quote marks)
+					if (!is_array($v)) {
+						$saveContent .= $v . "\n";
+					} else {
+						// change newlines in the value
+						$value = preg_replace( '/(\r\n)|(\n\r)|(\n)/', '\n', $v['edit'] );
+						// change single-quotes or backticks in the value
+						if ($options['backticks']>0) {
+							$value = strtr( $value, "'", '`' );
+						} else if ($options['backticks']<0) {
+							$value = strtr( $value, '`', "'" );
+						}
+						// set back to $editData
+						$editData[$k]['edit'] = $value;
+						// add to file content
+						$saveContent .= $k . '=' . $value . "\n";
+						// if the string is in the selected language file
+						if (isset($v['lang_file'])) {
+							// and it has changed (via the user form)
+							if ($v['lang_file'] != $v['edit']) {
+								// log the change in a translation array
+								$changedStrings[ "\n".$k.'='.$v['lang_file'] ] = "\n".$k.'='.$v['edit'];
+							}
+						}
+					}
+				}
+
+				// if there is no reference Language File, automatically initialise/create one which is the same as the selected language file
+				if ($options['refLangMissing']) {
+					if ( JFile::write( $options['refLangPath'].DS.$options['refLangFile'], trim($saveContent) ) ) {
+						$mainframe->enqueueMessage(sprintf(JText::_('Language INI Created'), $options['refLangFile'] ) );
+					}
+				}
+
+				// 1: write the selected language file and clear newprocess flag
+				// 2: report failure
+				if ( JFile::write( $options['path_file'], trim($saveContent) ) ) {
+					$mainframe->enqueueMessage(sprintf(JText::_('Language INI '.(($options['newprocess'])?'Created':'Saved') ),$options['clientName'],$options['filename'] ) );
+					$options['newprocess'] = 0;
+				} else {
+					$mainframe->enqueueMessage( sprintf(JText::_('Could not write to file'),$options['path_file']) );
+				}
+
+				// process changed strings globally across all the the ini files from the selected language directory
+				if ( (count($changedStrings)) && ($options['globalChanges']) ) {
+					$write = 0;
+					$writeFiles = array();
+					if ($files = JFolder::files($options['langPath'])) {
+						foreach ($files as $file) {
+							// skip non-INI files
+							// skip this file
+							// skip this file (unpublished)
+							// skip checked out files
+							if	(
+								(strtolower(substr($file,-4)!='.ini'))
+								|| ($file==$options['filename'])
+								|| ($file=='xx.'.$options['filename'])
+								|| (array_search($options['langPath'].DS.'chk.'.$file,$files))
+								) {
+								continue;
+							}
+
+							// otherwise grab the file content
+							if ($content = file_get_contents($options['langPath'].DS.$file)) {
+								// parse the changed strings
+								$new_content = strtr( $content, $changedStrings );
+								// check for changes then write to the file
+								if ($new_content != $content) {
+									if ( JFile::write( $options['langPath'].DS.$file, trim($new_content) ) ) {
+										$writeFiles[$write++] = $file;
+									}
+								}
+							}
+						}
+					}
+					// report
+					if ($write) {
+						$mainframe->enqueueMessage( sprintf(JText::_('Global String Change'), $write, implode('; ',$writeFiles) ) );
+					}
+				}
+			}
+
+		}
+
+		// 1: checkin when we are saving (this will redirect also)
+		// 2: call the html when we are editing or applying (and checkout existing files)
+		if ($options['task'] == 'save') {
+			$this->_multitask( 'checkin', $options['filename'], 'files', false );
+		} else {
+			$view = $this->getView( $this->_name, 'html');
+			$view->setLayout( 'edit' );
+			$view->assignRef( 'data', $editData );
+			$view->assignRef( 'meta', $editMeta );
+			$view->assignRef( 'options', $options );
+			$view->display();
+			if (!$options['newprocess']) {
+				$this->_multitask( 'checkout', $options['filename'], false, false );
+			}
+		}
+	}
+
+	/**
+	* Create Edit or Save an XML Language File
+	* @uses HTML_translationsmanager::editINI 	To build and output the HTML when editing or applying changes
+	*/
+	function editXML()
+	{
+		// import file functions
+		jimport('joomla.filesystem.file');
+
+		// variables
+		global $mainframe;
+		$options =& $this->getOptions();
+		$options['field_error_list'] = array();
+
+		// new tasks set newprocess
+		if ($options['task']=='addxml') {
+			$options['newprocess'] = 1;
+			$mainframe->enqueueMessage( JText::_('Tag Desc') );
+
+		}
+
+		// when we are in the process of creating a new file
+		// the client is passed by the 'addclient' field
+		// the language tag is passed by the 'tag' field
+		if ($options['newprocess']) {
+
+			// get the client and set the client name and path
+			$client = JRequest::getVar('newclient','','','string');
+			if (($client=='A')||($client=='I')||($client=='S')){
+				$options['client'] = $client;
+				if ($options['client']=='A') {
+					$options['basePath'] = JPATH_ADMINISTRATOR;
+					$options['clientKey'] = 'administrator';
+				} else if ($options['client']=='I') {
+					$options['basePath'] = JPATH_INSTALLATION;
+					$options['clientKey'] = 'installation';
+				} else {
+					$options['basePath'] = JPATH_SITE;
+					$options['clientKey'] = 'site';
+				}
+				$options['clientName'] = JText::_( $options['clientKey'] );
+			}
+
+			// validate the language tag (split, check case, reassemble, on failure report error and change task)
+			// report error and change task if we need to
+			$tag_split = preg_split( "/[^a-z]/i", JRequest::getVar('tag','','','string') );
+			$tag = strtolower($tag_split[0]) . '-' . strtoupper($tag_split[1]);
+			print_r($tag);
+            if (!preg_match('/^[a-z]{2,3}-[A-Z]{2}$/',$tag)) {
+				$options['field_error_list']['tag'] = JText::_('Tag Desc');
+				if ($options['task']!='addxml') {
+					$options['task'] = 'editxml';
+				}
+			}
+
+			// set variables
+			$options['client_lang'] = $options['client'].'_'.$tag;
+			$options['lang'] = $tag;
+			$options['langPath'] = $options['basePath'].DS.'language'.DS.$options['lang'];
+			$options['filename'] = $tag.'.xml';
+		}
+		// otherwise we use the selected language XML file
+		else {
+			$options['filename'] = $options['lang'].'.xml';
+		}
+
+		// initialise the $editData array (with all the necessary entries)
+		// any extra entries in the XML file will be retained but are not editable
+		$editData = array(
+			'tag' => '',
+			'name' => '',
+			'description' => '',
+			'version' => '1.5.0',
+			'creationDate' => date('Y-m-d'),
+			'author' => '',
+			'authorUrl' => '',
+			'authorEmail' => '',
+			'copyright' => '',
+			'license' => 'http://www.gnu.org/copyleft/gpl.html GNU/GPL',
+			'metadata' => array(
+				'name' => '',
+				'tag' => '',
+				'rtl' => 0,
+				'locale' => '',
+				'winCodePage' => 'iso-8859-1',
+				'backwardLang' => '',
+				'pdfFontName' => 'vera'
+			),
+			'params' => '',
+		);
+
+		// load the XML file (if there is one, there won't be when creating a new language)
+		// if a filename exists when we are creating a new file we will copy values from it
+		$xml = & JFactory::getXMLParser('Simple');
+		if (JFile::exists($options['langPath'].DS.$options['filename'])) {
+			if ($xml->loadFile($options['langPath'].DS.$options['filename'])) {
+				// go through each child of the xml root (using the XML file as master)
+				// all the nodes in the XML file are parsed in lowercase
+				// do it this way to ensure that we retain all the existing data in the XML file
+				foreach( $xml->document->children() as $node ) {
+					// main nodes
+					if ($node->name()!='metadata') {
+					   $editData[$node->name()] = $node->data();
+					}
+					// metadata nodes
+					else {
+						foreach ($node->children() as $subnode) {
+							$editData['metadata'][$subnode->name()] = $subnode->data();
+						}
+					}
+				}
+				// copy any lowercase keys to mixed case keys
+				// remove the lowercase key afterwards
+				foreach ($editData as $k=>$v) {
+				    if ($k!='metadata') {
+				        $k_lc = strtolower($k);
+    				    if ( $k_lc != $k ) {
+    				        $editData[$k] = $editData[$k_lc];
+    				        unset($editData[$k_lc]);
+                        }
+				    } else {
+            			foreach ($editData['metadata'] as $k=>$v) {
+        				    $k_lc = strtolower($k);
+        				    if ( $k_lc != $k ) {
+        				        $editData['metadata'][$k] = $editData['metadata'][$k_lc];
+        				        unset($editData['metadata'][$k_lc]);
+                            }
+        	            }
+                    }
+				}
+                // ensure that metadata and main body values match
+				foreach ($editData['metadata'] as $k=>$v) {
+        			if (isset($editData[$k])) {
+						$editData[$k] = $v;
+					}
+				}
+			}
+		}
+		// require a valid XML file (unless creating a new language)
+		else if (!$options['newprocess']) {
+			$mainframe->enqueueMessage( sprintf(JText::_('Invalid XML File'),$options['langPath'].DS.$options['filename']) );
+			$mainframe->redirect( 'index.php?option=com_translationsmanager' );
+		}
+
+		// apply the user form data (only when not empty)
+		foreach($editData as $k=>$v){
+			// check the main nodes
+			if (is_string($v)) $editData[$k] = JRequest::getVar($k,$v,'','string');
+			// check the metadata nodes
+			else if (is_array($v)) {
+				foreach($v as $k2=>$v2)	$editData[$k][$k2] = JRequest::getVar($k2,$v2,'','string');
+			}
+		}
+
+		// validate the language name values
+		$editData['metadata']['pdfFontName'] = strtolower($editData['metadata']['pdfFontName']);
+		$editData['metadata']['rtl'] = intval($editData['metadata']['rtl']);
+
+		// validate required (non-blank)
+		$required = array ('tag','name','version','creationDate','author','locale','winCodePage','backwardLang','pdfFontName');
+		foreach ($required as $v) {
+			if ( (isset($editData[$v])) && (empty($editData[$v])) ) {
+				$options['field_error_list'][$v] = JText::_($v);
+			} else if ( (isset($editData['metadata'][$v])) && (empty($editData['metadata'][$v])) ) {
+				$options['field_error_list'][$v] = JText::_($v);
+			}
+		}
+		// report any errors and change the task
+		if (($options['field_error_list'])&&($options['task']!='addxml')) {
+			$mainframe->enqueueMessage( sprintf( JText::_('Values Required'), implode(', ',$options['field_error_list']) ) );
+			$options['task'] = 'editxml';
+		}
+
+		// create a new file or save an existing file
+		if (($options['task']=='savexml')||($options['task']=='applyxml')) {
+
+			// ensure the file does not already exist when we are creating a new language
+			if ( ($options['newprocess'])&&(JFile::exists($options['langPath'].DS.$options['filename'])) ) {
+				// report error and set task flag
+				$mainframe->enqueueMessage( sprintf(JText::_('Language XML Exists'), $options['lang'] ));
+				$options['task'] = 'editxml';
+			}
+
+			// otherwise build and save the file
+			else {
+
+				// build the file content
+				$saveData = '<?xml version="1.0" encoding="utf-8"?>'."\n";
+				$saveData .= '<metafile version="1.5"  client="' . $options['clientKey'] . '" >'."\n";
+				foreach($editData as $k=>$v){
+					if (is_string($v)) {
+						$saveData .= "\t".'<'.$k.'>'.htmlspecialchars($v).'</'.$k.'>'."\n";
+					}
+					else if (is_array($v)) {
+						$saveData .= "\t".'<'.$k.'>'."\n";
+						foreach($v as $k2=>$v2){
+							$saveData .= "\t\t".'<'.$k2.'>'.htmlspecialchars($v2).'</'.$k2.'>'."\n";
+						}
+						$saveData .= "\t".'</'.$k.'>'."\n";
+					}
+				}
+				$saveData .= '</metafile>'."\n";
+
+				// create the directory when we are creating a language
+				// do this manually because JFile::write does not work on windows (
+				if ($options['newprocess']) {
+					jimport('joomla.filesystem.folder');
+					if (!JFolder::create($options['langPath'])) {
+						// report failure and set task flag
+						$mainframe->enqueueMessage( sprintf(JText::_('Folder Created'),$options['langPath'] ) );
+						$options['task'] = 'applyxml';
+					}
+				}
+
+				// write the XML file (this will create a new file or overwrite an existing file)
+				// 1: report new/existing file and clear new process flag
+				// 2: report failure and set task flag if we can't write
+				if ( JFile::write( $options['langPath'].DS.$options['filename'], $saveData ) ) {
+					$msg = ($options['newprocess']) ? 'Language XML Created' : 'Language XML Saved' ;
+					$mainframe->enqueueMessage( sprintf(JText::_($msg),$options['clientName'],$options['lang']) );
+					$options['newprocess'] = 0;
+				} else {
+					$mainframe->enqueueMessage( sprintf(JText::_('Could not write to file'),$options['langPath'].DS.$options['filename']) );
+					$options['task'] = 'applyxml';
+				}
+			}
+		}
+
+		// redirect or show HTML after saving
+		if ($options['task'] == 'savexml') {
+			$mainframe->redirect( 'index.php?option=com_translationsmanager' );
+		} else {
+			$view = $this->getView( $this->_name, 'html');
+			$view->setLayout( 'editxml' );
+			$view->assignRef( 'data', $editData );
+			$view->assignRef( 'options', $options );
+			$view->display();
+		}
+	}
+
+	/**
+	* Get the configuration options.
+	* @return array	The Configuration in an array
+	*/
+	function &getOptions () {
+
+		if (!isset($this->_options)) {
+			$this->_options = $this->_buildoptions();
+		}
+		return $this->_options;
+	}
+
+	/**
+	* Make a language the default language for a client
+	*/
+	function setDefault( )
+	{
+        // variables
+    	global $mainframe;
+    	$params = JComponentHelper::getParams('com_languages');
+
+        $options =& $this->getOptions();
+        if ($options['client']=='A') {
+            $client = 'administrator';
+        } else if ($options['client']=='S') {
+            $client = 'site';
+        } else if ($options['client']=='I') {
+            $client = 'installation';
+        } else {
+            return false;
+        }
+		$lang = $options['lang'];
+
+    	// check for request forgeries.
+    	$token = JUtility::getToken();
+    	if (!JRequest::getInt($token, 0, 'post')) {
+    		JError::raiseError(403, 'Request Forbidden');
+    	}
+
+    	// set variables
+    	$params->set($client, $lang);
+    	$table =& JTable::getInstance('component');
+	    $table->loadByOption( 'com_languages' );
+    	$table->params = $params->toString();
+
+    	// save the changes
+        if (!$table->check()) {
+    		JError::raiseWarning( 500, $table->getError() );
+    		$write = false;
+        } else if (!$table->store()) {
+    		JError::raiseWarning( 500, $table->getError() );
+    		$write = false;
+    	} else {
+            $write = true;
+        }
+
+		// Redirect on success/failure
+		if ($write) {
+			$mainframe->redirect('index.php?option=com_translationsmanager', sprintf( JText::_('Default Language Saved'), JText::_($client), $options['lang'] )  );
+		} else {
+			$mainframe->redirect('index.php?option=com_translationsmanager', JText::_('ERRORCONFIGWRITEABLE') );
+		}
+    }
+
+	/**
+	* Show Credits/Homepage for the component
+	*/
+	function credits()
+	{
+		// call the html view
+		$view = $this->getView( $this->_name, 'html');
+		$view->setLayout( 'credits' );
+		$view->display();
+	}
+
+	/**
+	* Show a List of INI Translation Files for a given Client-Language
+	*/
+	function files()
+	{
+		// filesystem functions
+		jimport('joomla.filesystem.folder');
+		jimport('joomla.filesystem.file');
+
+		// variables
+		global $mainframe;
+		$options =& $this->getOptions();
+		$user = &JFactory::getUser();
+		$userid = $user->get('id',0);
+
+		// build client_lang select box
+		foreach ($options['languages'] as $k=>$v) {
+			$sel_lang[] = JHTML::_( 'select.option', $k, $v );
+		}
+		$lists['client_lang'] = JHTML::_( 'select.genericlist', $sel_lang, 'client_lang', 'class="inputbox" size="1" onchange="document.adminForm.limitstart.value=0;document.adminForm.submit( );"', 'value', 'text', $options['client_lang'] );
+
+		// validate all the filters (specific to this view)
+		$allowed = array(
+			'client_lang'			=> '',
+			'filter_search' 		=> '',
+			'filter_state' 			=> '*|U|P',
+			'filter_status' 		=> '*|NS|IP|C',
+			'filter_order' 			=> 'name|status|strings|version|datetime|author',
+			'filter_order_Dir' 		=> 'asc|desc',
+			'limit' 				=> $mainframe->getCfg('list_limit')
+		);
+		$filters = $this->_buildfilters( $allowed, 'com_translationsmanager.files.' );
+
+		// copy to $options
+		$options = array_merge( $options, $filters );
+
+		// copy to $lists
+		$lists['order'] = $options['filter_order'];
+		$lists['order_Dir'] = $options['filter_order_Dir'];
+
+		// validate and build the filter_search box
+		$options['dosearch'] = '';
+		if ($options['filter_search']) {
+			// 1: turn it into a case-insensitive regexp
+			// 2: check and use a submitted regexp
+			// 3: invalid regexp
+			if ($options['filter_search']{0}!='/') {
+				$options['dosearch'] = '/.*'.trim($options['filter_search'],'/').'.*/i';
+			} else if ( @preg_match($options['filter_search'],'') !== false ) {
+				$options['dosearch'] = $options['filter_search'];
+			} else {
+				$mainframe->enqueueMessage( JText::_('Search') . ': ' . sprintf( JText::_('Invalid RegExp'), htmlentities($options['filter_search']) ), 'error' );
+				$options['filter_search'] = '';
+			}
+		}
+		$lists['search'] = '<input name="filter_search" id="filter_search" class="inputbox" "type="text" value="'.htmlspecialchars($options['filter_search'],ENT_QUOTES).'" onchange="this.form.submit();" size="15" />';
+
+		// build the filter_state select box
+		$extra = 'class="inputbox" size="1" onchange="document.adminForm.submit();"';
+		$sel_state[] = JHTML::_( 'select.option',  '*', JText::_( 'Any State' ) );
+		$sel_state[] = JHTML::_( 'select.option',  'P', JText::_( 'Published' ) );
+		$sel_state[] = JHTML::_( 'select.option',  'U', JText::_( 'Not Published' ) );
+		$lists['state'] = JHTML::_( 'select.genericlist',  $sel_state, 'filter_state', $extra, 'value', 'text', $options['filter_state'] );
+
+		// build the filter_status select box
+		$sel_status[] = JHTML::_( 'select.option',  '*', JText::_( 'Any Status' ) );
+		$sel_status[] = JHTML::_( 'select.option',  'NS', JText::_( 'Not Started' ) );
+		$sel_status[] = JHTML::_( 'select.option',  'IP', JText::_( 'In Progress' ) );
+		$sel_status[] = JHTML::_( 'select.option',  'C', JText::_( 'Complete' ) );
+		if ($options['isReference']) {
+			$options['filter_status'] = '*';
+		}
+		if ($options['lang'] == $options['refLang']) {
+			$extra .= ' disabled';
+		}
+		$lists['status'] = JHTML::_( 'select.genericlist',  $sel_status, 'filter_status', $extra, 'value', 'text', $options['filter_status'] );
+
+		// create objects for loading data
+		$refLangLoader = new JLanguage( $options['refLang'] );
+		$LangLoader = ( $options['lang'] == $options['refLang'] ) ? $refLangLoader : new JLanguage( $options['lang'] );
+
+		// load all the the ini filenames (published or unpublished) from the reference directory
+		// load the same from the selected language directory
+		$refLangFiles = JFolder::files( $options['refLangPath'] , '^(xx|'.$options['refLang'].')[.].*ini$' );
+		if ($options['isReference']) {
+			$LangFiles = array_flip( $refLangFiles );
+		} else {
+			$LangFiles = JFolder::files( $options['langPath'] , '^(xx|'.$options['lang'].')[.].*ini$' );
+			$LangFiles = array_flip( $LangFiles );
+		}
+
+		// build a composite filename list, keyed using the filename without language tag
+		$allFiles = array();
+		foreach ( $refLangFiles as $v ) {
+			$k = preg_replace('/^(xx[.])*'.$options['refLang'].'[.]/','',$v);
+			$allFiles[$k]['refLang'] = $v;
+		}
+		foreach ( $LangFiles as $v=>$k ) {
+			$k = preg_replace('/^(xx[.])*'.$options['lang'].'[.]/','',$v);
+			$allFiles[$k]['lang'] = $v;
+		}
+
+		// get default metadata for the selected language
+		$xmlData = TranslationsHelper::getXMLMeta( $options['langPath'].DS.$options['lang'].'.xml' );
+
+		// process the reference language INI files and compare them against the files for the selected language
+		$rows = array ();
+		$rowid = 1;
+		foreach ($allFiles as $k=>$v)	{
+
+			// get the content, bare filename, Meta and Strings from the reference language INI file
+			// in some cases there may not be a reference language INI file
+			if (isset($v['refLang'])) {
+				$refContent = file( $options['refLangPath'].DS.$v['refLang'] );
+                $refFileName = ( substr($v['refLang'],0,3)=='xx.' ) ?  substr($v['refLang'],3) : $v['refLang'];
+				$fileName = $options['lang'] . substr($refFileName,$options['refLangLen']);
+				$refStrings = array();
+				$refMeta  = TranslationsHelper::getINIMeta( $refContent, $refStrings );
+			} else {
+				$refContent = array();
+				$fileName = ( substr($v['lang'],0,3)=='xx.' ) ?  substr($v['lang'],3) : $v['lang'];
+				$refFileName = $options['refLang'] . substr($fileName,$options['langLen']);
+				$refStrings = array();
+				$refMeta  = array(
+					'author' => '',
+					'date' => '',
+					'strings' => '',
+					'time' => '',
+					'version' => ''
+				);
+			}
+
+			// initialise the row
+			$row = new StdClass();
+			$row->author 		= $refMeta['author'];
+			$row->bom 			= 'UTF-8';
+			$row->checkedout 	= 0;
+			$row->changed 		= 0;
+			$row->date 			= $refMeta['date'];
+			$row->extra 		= 0;
+			$row->filename 		= $fileName;
+			$row->id 			= $rowid++;
+			$row->name 			= substr($row->filename,($options['langLen']+1),-4);
+			$row->refexists 	= intval( isset($v['refLang']) );
+			$row->reffilename 	= $refFileName;
+			$row->refstrings	= $refMeta['strings'];
+			$row->searchfound 	= 0;
+			$row->status 		= 0;
+			$row->strings 		= $refMeta['strings'];
+			$row->time 			= $refMeta['time'];
+			$row->unchanged		= 0;
+			$row->unpub_filename = 'xx.'.$row->filename;
+			$row->version 		= $refMeta['version'];
+
+			// 1: file is published
+			// 2: file is unpublished
+			// 3: file does not exist
+			if ( JFile::exists($options['langPath'].DS.$row->filename) ) {
+				$row->exists 		= 1;
+				$row->path_file 	= $options['langPath'].DS.$row->filename;
+				$row->published 	= 1;
+				$row->writable 		= is_writable($row->path_file);
+			} else if ( JFile::exists($options['langPath'].DS.$row->unpub_filename) ) {
+				$row->exists 		= 1;
+				$row->path_file 	= $options['langPath'].DS.$row->unpub_filename;
+				$row->published 	= 0;
+				$row->writable 		= is_writable($row->path_file);
+			} else {
+				$row->author 		= '';
+				$row->date	 		= '';
+				$row->exists 		= 0;
+				$row->path_file 	= $options['langPath'].DS.$row->unpub_filename;
+				$row->published 	= 0;
+				$row->status 		= 0;
+				$row->version 		= '';
+				$row->writable 		= 1;
+			}
+
+			// get the checkout status of the selected file
+			if ( $content = @file_get_contents($options['langPath'].DS.'chk.'.$row->filename)) {
+				$row->checkedout = ( (strpos($content,'#'.$userid.'#')) || (strpos($content,'#0#')) ) ? 0 : 1;
+			}
+
+			// scan an existing language file
+			if ( (!$options['isReference']) && ($row->exists) ) {
+				$fileContent = file($row->path_file);
+				$fileStrings = array();
+				$fileMeta = TranslationsHelper::getINIMeta( $fileContent, $fileStrings, $refStrings );
+				if ( $fileMeta['bom'] == 'UTF-8' ) {
+					foreach ($fileMeta as $k=>$v) {
+						$row->{$k} = $v;
+					}
+				} else {
+					$row->bom = $fileMeta['bom'];
+					$row->writable = 0;
+				}
+			} else {
+				$fileContent = array();
+				$fileStrings = array();
+				$fileMeta = array();
+			}
+
+			// search the files
+			// $refContent and $fileContent are arrays containing each line of the reference and translation file
+			if ( $options['dosearch'] ) {
+				$row->searchfound_ref = preg_match_all($options['dosearch'], implode("\n",$refContent), $arr );
+                if (! $options['isReference'] ) {
+                    $row->searchfound_tran = preg_match_all($options['dosearch'], implode("\n",$fileContent), $arr );
+                } else {
+                    $row->searchfound_tran = $row->searchfound_ref;
+                }
+				$row->searchfound = $row->searchfound_ref + $row->searchfound_tran;
+			}
+
+			// set the datetime
+			$row->datetime = $row->date.$row->time;
+
+			// change the name
+			if ($row->name == '') {
+				$row->name = ' [core]';
+			}
+
+			// store the file
+			$rows[$row->name] = $row;
+		}
+
+
+		// build the fileset totals and filter out rows we don't need/want
+		$options['fileset-files'] 	= 0;
+		$options['fileset-exists'] 	= 0;
+		$options['fileset-published'] = 0;
+		$options['fileset-refstrings'] = 0;
+		$options['fileset-changed'] = 0;
+		foreach( $rows as $k=>$row) {
+			// add to totals
+			$options['fileset-files']++;
+			$options['fileset-exists'] 		+= $row->exists;
+			$options['fileset-published'] 	+= $row->published;
+			$options['fileset-refstrings'] 	+= $row->refstrings;
+			$options['fileset-changed'] 	+= $row->changed;
+
+			// filter out searched items
+			// filter out published or unpublished items
+			// filter out status of items
+			if 	(
+				( ($options['dosearch']) && ($row->searchfound == 0) )
+			||	( ($options['filter_state']=='P') && ($row->published <> 1) )
+			||	( ($options['filter_state']=='U') && ($row->published <> 0) )
+			||	( ($options['filter_status']=='NS') && ($row->status > 0) )
+			||	( ($options['filter_status']=='IP') && (($row->status <= 0)||($row->status >= 100)) )
+			||	( ($options['filter_status']=='C') && ($row->status < 100) )
+				) {
+				unset($rows[$k]);
+			}
+		}
+
+		// set fileset status
+		if ($options['fileset-changed'] == 0) {
+			$options['fileset-status'] = 0;
+		}
+		if ($options['fileset-refstrings'] == $options['fileset-changed']) {
+			$options['fileset-status'] = 100;
+		} else {
+			$options['fileset-status'] = floor( ($options['fileset-changed']/$options['fileset-refstrings'])*100 );
+		}
+
+		// build the pagination
+		jimport('joomla.html.pagination');
+		$pageNav = new JPagination( count($rows), $options['limitstart'], $options['limit'], 'index.php?option=com_translationsmanager&amp;task=files' );
+
+		// sort the $rows array
+		$order_Int = (strtolower($lists['order_Dir'])=='desc') ? -1 : 1;
+		JArrayHelper::sortObjects( $rows, $lists['order'], $order_Int );
+
+		// slice the array so we only show one page
+		$rows = array_slice( $rows, $pageNav->limitstart, $pageNav->limit );
+
+		// call the html view
+		$view = $this->getView( $this->_name, 'html');
+		$view->setLayout( 'files' );
+		$view->assignRef( 'data', $rows );
+		$view->assignRef( 'options', $options );
+		$view->assignRef( 'lists', $lists );
+		$view->assignRef( 'pagenav', $pageNav );
+		$view->display();
+	}
+
+	/**
+	* Show a List of installed Languages (XML files)
+	*/
+	function languages()
+	{
+		// variables
+		global $mainframe;
+		$options =& $this->getOptions();
+
+		// default languages
+		$params = JComponentHelper::getParams('com_languages');
+		$default['A'] = $params->get('administrator','en-GB');
+		$default['I'] = $params->get('installation','en-GB');
+		$default['S'] = $params->get('site','en-GB');
+
+		// validate all the filters (specific to this view)
+		// each filter key has a list of allowed values; the first is the default value
+		// a blank value skips validation
+		// the  key "limit" allows any integer
+		$allowed = array(
+			'filter_client' 	=> '*|' . implode( '|', array_keys($options['clients']) ),
+			'filter_order' 		=> 'tag',
+			'filter_order_Dir' 	=> 'asc|desc',
+			'limit' 			=> $mainframe->getCfg('list_limit')
+		);
+		$filters = $this->_buildfilters( $allowed, 'com_translationsmanager.languages.' );
+
+		// copy to $options
+		$options = array_merge( $options, $filters );
+
+		// copy to $lists
+		$lists['order'] 	= $options['filter_order'];
+		$lists['order_Dir'] = $options['filter_order_Dir'];
+
+		// get the list of languages
+		$rows = array();
+		foreach ($options['languages'] as $k=>$v) {
+			$row = new StdClass();
+			$row->tag = substr($k,2);
+			$row->client = strtoupper($k{0});
+			$row->client_lang = $k;
+			$row->filename = $row->tag . '.xml';
+
+			// check filter
+			if ($options['filter_client']!='*') {
+				if ($row->client != $options['filter_client']) {
+					continue;
+				}
+			}
+
+			// check default status
+			$row->isdefault = intval( $default[$row->client]==$row->tag );
+
+			// get the directory path
+			if ($k{0}=='A') {
+				$path = JPATH_ADMINISTRATOR;
+				$row->client_name = JText::_('Administrator');
+			} else if ($k{0}=='I') {
+				$path = JPATH_INSTALLATION;
+				$row->client_name = JText::_('Installation');
+			} else {
+				$path = JPATH_SITE;
+				$row->client_name = JText::_('Site');
+			}
+			$path .= DS.'language'.DS.$row->tag;
+
+			// count the number of INI files (published or unpublished)
+			$row->files = count( JFolder::files( $path, '(xx[.]|^)'.$row->tag.'.*ini$' ) );
+
+			// load and add XML attributes
+			// force the tag
+		    $data = TranslationsHelper::getXMLMeta($path.DS.$row->filename);
+			$data['tag'] = $row->tag;
+ 			foreach($data as $k2=>$v2) {
+				$row->$k2 = $v2;
+			}
+
+			// add to rows
+			$rows[] = $row;
+		}
+
+		// build the pagination
+		jimport('joomla.html.pagination');
+		$pageNav = new JPagination( count($rows), $options['limitstart'], $options['limit'], 'index.php?option=com_translationsmanager' );
+
+		// sort the $rows array
+		$order_Int = (strtolower($lists['order_Dir'])=='desc') ? -1 : 1;
+		JArrayHelper::sortObjects( $rows, $lists['order'], $order_Int );
+
+		// slice the array so we only show one page
+		$rows = array_slice( $rows, $pageNav->limitstart, $pageNav->limit );
+
+		// call the html view
+		$view = $this->getView( $this->_name, 'html');
+		$view->setLayout( 'languages' );
+		$view->assignRef( 'data', $rows );
+		$view->assignRef( 'options', $options );
+		$view->assignRef( 'lists', $lists );
+		$view->assignRef( 'pagenav', $pageNav );
+		$view->display();
+	}
+
+	/**
+	* Package INI files into an installation zip file
+	*/
+	function package()
+	{
+		// variables
+		global $mainframe;
+		$options =& $this->getOptions();
+		$files = array();
+
+		// set the zip path
+		// optionally change the tag if there is a [tag=xx-XX] in the path
+		$zippath = '/' . $options['config']->get( 'zippath', 'tmp/[tag].[client].zip' );
+		$ziptag = $options['lang'];
+		if ( preg_match('/\[tag=([^\]]*)\]/',$zippath,$match) ) {
+			$zippath = str_replace($match[0],'[tag]',$zippath);
+			if ( preg_match('/^[a-z]{2}-[a-z]{2}$/i',$match[1]) ) {
+				$ziptag = strtolower(substr($match[1],0,2)) . '-' . strtoupper(substr($match[1],-2));
+				$mainframe->enqueueMessage( sprintf( JText::_('ZIP Translate Tag'), $options['lang'], $ziptag ) );
+			}
+		}
+
+		// process all the files in the selected language directory into an array ready to be packaged
+		// translate the language tag if configured
+		jimport('joomla.filesystem.file');
+		foreach ( JFolder::files( $options['langPath'] ) as $k=>$filename ) {
+			// 1: grab the XML data and info
+			// 2a: skip checkout marker files
+			// 2b: grab the INI data into the files array
+			if ( $filename == $options['lang'].'.xml' ) {
+				$xmlname = $filename;
+				$xmldata = file_get_contents( $options['langPath'].DS.$filename );
+				$xmltime = filemtime( $options['langPath'].DS.$filename );
+				$xml = TranslationsHelper::getXMLMeta( $options['langPath'].DS.$filename );
+				$xml['client'] 	= $options['clientKey'];
+				$xml['tag'] 	= $ziptag;
+				$xmlname = str_replace($options['lang'],$ziptag,$xmlname);
+				$xmldata = str_replace($options['lang'],$ziptag,$xmldata);
+			} else if ( substr($filename,-4)=='.ini') {
+				if ( substr($filename,0,4)=='chk.' ) {
+					continue;
+				} else {
+					$k = ( substr($filename,0,3)=='xx.' ) ? substr($filename,3) : $filename;
+					$k = str_replace($options['lang'],$ziptag,$k);
+					$files[$k]['name'] = $k;
+					$files[$k]['data'] = file_get_contents( $options['langPath'].DS.$filename );
+					$files[$k]['time'] = filemtime( $options['langPath'].DS.$filename );
+				}
+			}
+		}
+
+		// check we have XML data and files
+		if (!isset($xml)) {
+			JError::raiseNotice( 500, sprintf( JText::_('ZIP No XML'), $options['clientKey'].'DS'.$options['lang'].'.xml'  ) );
+		} else if (!count($files)) {
+			JError::raiseNotice( 500, sprintf( JText::_('ZIP No Files'), $options['clientKey'] ) );
+		} else {
+
+			// sort the files
+			ksort($files);
+
+			// build the XML install file
+			$install = '<?xml version="1.0" encoding="utf-8" ?>
+<install version="1.5" client="' . $xml['client'] .'" type="language">
+    <name>' . $xml['name'] .'</name>
+    <tag>' . $xml['tag'] .'</tag>
+    <version>' . $xml['version'] .'</version>
+    <creationDate>' . $xml['creationDate'] .'</creationDate>
+    <author>' . $xml['author'] .'</author>
+    <authoremail>' . $xml['authorEmail'] .'</authoremail>
+    <authorurl>' . $xml['authorUrl'] .'</authorurl>
+    <copyright>' . $xml['copyright'] .'</copyright>
+    <license>' . $xml['license'] .'</license>
+    <description>' . $xml['description'] .'</description>
+    <files>';
+	foreach ( $files as $k=>$v ) {
+		$install .= '
+		<filename>' . $v['name'] . '</filename>';
+	}
+	$install .= '
+		<filename file="meta">' . $xmlname . '</filename>
+	</files>
+	<params />
+</install>';
+
+			// finish the files array
+			$files['xml']['name'] = $xmlname;
+			$files['xml']['data'] = $xmldata;
+			$files['xml']['date'] = $xmltime;
+			$files['install']['name'] = 'install.xml';
+			$files['install']['data'] = $install;
+			$files['install']['date'] = time();
+
+			// configure the package filename and type
+			$type = substr( $zippath, strrpos( $zippath, '.' ) + 1 );
+			$zippath = str_replace( '[client]', $xml['client'], $zippath );
+			$zippath = str_replace( '[tag]', $xml['tag'], $zippath );
+			$ziproot = JPATH_ROOT.$zippath;
+			$zipfile = substr( $zippath, strrpos( $zippath, DS ) + 1 );
+			$ziplink = JURI::root() . $zipfile;
+
+			// run the packager
+			jimport('joomla.filesystem.archive');
+			if ( !$packager =& JARchive::getAdapter( $type ) ) {
+				JError::raiseWarning( 500, sprintf( JText::_('ZIP Adapter Failure'), $type ) );
+			} else if ( $packager->create( $ziproot, $files, array() ) ) {
+				$mainframe->enqueueMessage( sprintf( JText::_('ZIP Create Success'), $ziplink, $zipfile ) );
+			} else {
+				JError::raiseNotice( 500, sprintf( JText::_('ZIP Create Failure'), $ziplink ) );
+			}
+
+		}
+
+		// Redirect to the default page
+		$mainframe->redirect( 'index.php?option=com_translationsmanager' );
+	}
+
+}
+?>
diff -aruN --binary 21/administrator/components/com_trash/admin.trash.php 22/administrator/components/com_trash/admin.trash.php
--- 21/administrator/components/com_trash/admin.trash.php	2010-07-18 05:15:44.000000000 +0200
+++ 22/administrator/components/com_trash/admin.trash.php	2010-11-03 19:12:02.000000000 +0100
@@ -1,6 +1,6 @@
 <?php
 /**
-* @version		$Id: admin.trash.php 18162 2010-07-16 07:00:47Z ian $
+* @version		$Id: admin.trash.php 19343 2010-11-03 18:12:02Z ian $
 * @package		Joomla
 * @subpackage	Trash
 * @copyright	Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
@@ -100,6 +100,10 @@
 		$filter_order = 'sectname';
 	}
 
+	if (!in_array(strtoupper($filter_order_Dir), array('ASC', 'DESC'))) {
+		$filter_order_Dir = '';
+	}
+
 	$orderby = ' ORDER BY '. $filter_order .' '. $filter_order_Dir .', s.name, cc.name, c.title';
 
 	// get the total number of content
@@ -177,6 +181,10 @@
 		$filter_order = 'm.menutype';
 	}
 
+	if (!in_array(strtoupper($filter_order_Dir), array('ASC', 'DESC'))) {
+		$filter_order_Dir = '';
+	}
+
 	$orderby 	= ' ORDER BY '. $filter_order . ' ' . $filter_order_Dir .', m.menutype, m.ordering, m.ordering,  m.name';
 
 	$query = 'SELECT count(*)'
@@ -410,4 +418,4 @@
 	}
 
 	return $row;
-}
\ No hay ningún carácter de nueva línea al final del fichero
+}
diff -aruN --binary 21/administrator/components/com_users/views/users/view.html.php 22/administrator/components/com_users/views/users/view.html.php
--- 21/administrator/components/com_users/views/users/view.html.php	2010-07-18 05:15:44.000000000 +0200
+++ 22/administrator/components/com_users/views/users/view.html.php	2010-11-03 19:12:02.000000000 +0100
@@ -1,6 +1,6 @@
 <?php
 /**
-* @version		$Id: view.html.php 18162 2010-07-16 07:00:47Z ian $
+* @version		$Id: view.html.php 19343 2010-11-03 18:12:02Z ian $
 * @package		Joomla
 * @subpackage	Users
 * @copyright	Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
@@ -93,10 +93,14 @@
 		}
 
 		// ensure filter_order has a valid value.
-		if (!in_array($filter_order, array('a.name', 'a.username', 'a.block', 'groupname', 'a.email', 'a.lastvisitdate', 'a.id'))) {
+		if (!in_array($filter_order, array('a.name', 'a.username', 'a.block', 'groupname', 'a.email', 'a.lastvisitDate', 'a.id'))) {
 			$filter_order = 'a.name';
 		}
 
+		if (!in_array(strtoupper($filter_order_Dir), array('ASC', 'DESC'))) {
+			$filter_order_Dir = '';
+		}
+
 		$orderby = ' ORDER BY '. $filter_order .' '. $filter_order_Dir;
 		$where = ( count( $where ) ? ' WHERE (' . implode( ') AND (', $where ) . ')' : '' );
 
@@ -170,4 +174,4 @@
 
 		parent::display($tpl);
 	}
-}
\ No hay ningún carácter de nueva línea al final del fichero
+}
diff -aruN --binary 21/administrator/components/com_weblinks/models/weblinks.php 22/administrator/components/com_weblinks/models/weblinks.php
--- 21/administrator/components/com_weblinks/models/weblinks.php	2010-07-18 05:15:44.000000000 +0200
+++ 22/administrator/components/com_weblinks/models/weblinks.php	2010-11-03 19:12:02.000000000 +0100
@@ -1,6 +1,6 @@
 <?php
 /**
- * @version		$Id: weblinks.php 18162 2010-07-16 07:00:47Z ian $
+ * @version		$Id: weblinks.php 19343 2010-11-03 18:12:02Z ian $
  * @package		Joomla
  * @subpackage	Content
  * @copyright	Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
@@ -152,6 +152,10 @@
 			$filter_order = 'a.ordering';
 		}
 
+		if (!in_array(strtoupper($filter_order_Dir), array('ASC', 'DESC'))) {
+			$filter_order_Dir = '';
+		}
+
 		if ($filter_order == 'a.ordering'){
 			$orderby 	= ' ORDER BY category, a.ordering '.$filter_order_Dir;
 		} else {
diff -aruN --binary 21/administrator/components/com_weblinks/views/weblinks/view.html.php 22/administrator/components/com_weblinks/views/weblinks/view.html.php
--- 21/administrator/components/com_weblinks/views/weblinks/view.html.php	2010-07-18 05:15:44.000000000 +0200
+++ 22/administrator/components/com_weblinks/views/weblinks/view.html.php	2010-11-03 19:12:02.000000000 +0100
@@ -1,6 +1,6 @@
 <?php
 /**
-* @version		$Id: view.html.php 18162 2010-07-16 07:00:47Z ian $
+* @version		$Id: view.html.php 19343 2010-11-03 18:12:02Z ian $
 * @package		Joomla
 * @subpackage	Weblinks
 * @copyright	Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
@@ -49,6 +49,10 @@
 			$filter_order = 'a.ordering';
 		}
 
+		if (!in_array(strtoupper($filter_order_Dir), array('ASC', 'DESC'))) {
+			$filter_order_Dir = '';
+		}
+
 		// Get data from the model
 		$items		= & $this->get( 'Data');
 		$total		= & $this->get( 'Total');
@@ -75,4 +79,4 @@
 
 		parent::display($tpl);
 	}
-}
\ No hay ningún carácter de nueva línea al final del fichero
+}
diff -aruN --binary 21/CHANGELOG.php 22/CHANGELOG.php
--- 21/CHANGELOG.php	2010-10-08 07:39:10.000000000 +0200
+++ 22/CHANGELOG.php	2010-11-03 16:00:56.000000000 +0100
@@ -1,6 +1,6 @@
 <?php
 /**
-* @version		$Id: CHANGELOG.php 19058 2010-10-08 04:15:39Z dextercowley $
+* @version		$Id: CHANGELOG.php 19340 2010-11-03 15:00:55Z ian $
 * @package		Joomla
 * @copyright	Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
 * @license		GNU/GPL, see LICENSE.php
@@ -36,6 +36,24 @@
 - -> Removed
 ! -> Note
 
+
+-------------------- 1.5.22 Stable Release [03-November-2010] ------------------
+
+03-Nov-2010 Ian MacLennan
+ # [#20255] 1.5.17 Session Bug
+ # [#21538] Empty menu item if menu type contains space or uppercase letter
+
+02-Nov-2010 Jean-Marie Simonet
+ ^ [#22961] Installation language modifications: aa-AA et-EE
+ ^ [#23098] Credits.php update
+ 
+20-Oct-2010 Ian MacLennan
+ # [#21489] CHANGELOG.php - segment twice exists
+ # [#21769] toolbar.content.html.php allow direct access
+ # [#21466] Backend user list ordering
+ # [#20256] Message "Database Error: Unable to connect to the database..." should return "500 Internal Server Error"
+ # [#18997] Fix for JFile::getExt()
+
 -------------------- 1.5.21 Stable Release [08-October-2010] ------------------
 
 
@@ -1711,671 +1729,3 @@
  # Fixed topic 244449 XMLRPC Search plugin doesn't work with weblinks search plugin published
 
 -------------------- 1.5.0 Release Candidate 4 Released [19-December-2007] ---------------------
-=======
-
-24-Apr-2008 Mati Kochen
- # Fix for the Legacy-Marker - missing parse
- # Removed the special treatment for RTL in Pagination
-
--------------------- 1.5.3 Stable Release [22-April-2008] ---------------------
-
-19-Apr-2008 Anthony Ferrara
- # [#10009] Search Function yields warning
- # [#10150] Installation minimum password length doesn't work
- # [#10725] Installation not xhtml compliant
- # [#10739] Spelling error in com_installer.ini
- # [#10092] Switcher hides nested divs
- # Fix for fatal error related to [#10638]
-
-19-Apr-2008 Andrew Eddie
- ! Trailing white-space cleanup
- # [#9725] JFilterInput Infinite Loop
-
-18-Apr-2008 Ian MacLennan
- # [#10732] Help screen updates for Menu Manager
-
-18-Apr-2008 Sam Moffatt
- # [#10724] Custom user groups fail to display
- # [#10707] update link to forum in Sample content
- # [#10638] mod_newsflash renders article separator after last article
-
-17-Apr-2008 Anthony Ferrara
- # [#9858] Flash Uploader not loading properly
- # [#10511] Print button showing Array Print Array
- # [#9775] Cache directory not writable causes warning
- # [#10588] QueryBatch executing empty queries
- # [#10675] Code Cleanup
- # [#10702] JURI::clean fix (not properly stripping out /'s) - Thanks Alex Stylianos
- # [#10308] Installer rejects valid DB names
- # [#10323] Wrong param count for class_exists in TCPDF
-
-14-Apr-2008 Mati Kochen
- + Offline validation
- + Legacy-Marker - a marker to show (admin) extensions requiring Legacy-Mode ON
-
-13-Apr-2008 Sam Moffatt
- # [#10639] mod_newsflash renders bad "read more" link text
- # [#10574] Problem with template rhuk_milkyway in white color variation.
- # [#10540] com_login not w3c valid
- # [#10539] Contacts string repeat twice in com_contacts language file
- # [#10510] /templates/beez/com_content/section/default.php
- # [#10302] Milky Way and Beez lack editor.css files
- # [#9984] Plugin parameters with pipes still not working perfectly
- # [#10402] Mainmenu Module issues
- # [#9977] Search module changing '-' to ':' in keywords
- # [#10097] Various XHTML fixes
-
-10-Apr-2008 Anthony Ferrara
- # [#10508] Caching pathway and breadcrumbs fix
- # [#10329] Debug fails with version of Zend Optimizer
-
-10-Apr-2008 Mati Kochen
- # [#10299] Added 'Use Global' as default value to weblink.xml
-
-09-Apr-2008 Mati Kochen
- # [#10253] Better PDF coding
-
-09-Apr-2008 Mati Kochen
- # [#10297] Fixed RTL in Offline message
-
-04-Apr-2008 Toby Patterson
- # Fixed [#10307] "Select Article" breaks on change category refresh ( Thanks Michael )
-
-03-Apr-2008 Toby Patterson
- # Fixed [#10197] component install error fails to reference left over folder in administrator/components folder
- # Fixed [#10200] jdoc:include type="module" not usable
- # Fixed [#10012] $task is not properly passed to extensions
- # Fixed [#10345] emailcloak is not removed if the article does not contain @
-
-29-Mar-2008 Ian MacLennan
- # Fixed [#9335] Extra/Random table class (sectionentrytable0)
-
-29-Mar-2008 Sam Moffatt
- ! Removed old TODO notice in installer
-
-28-Mar-2008 Wilco Jansen
- # Fixed [9118] Uncaught Error message in Extension Manager when uninstalling deleted component
- ! Thanks Ian for the patch
-
-26-Mar-2008 Toby Patterson
- # Fixed [9015] No .blank class in system general.css
-
--------------------- 1.5.2 Stable Release [22-March-2008] ---------------------
-
-22-Mar-2008 Sam Moffatt
- $ Added ko-KR installation language files
-
-21-Mar-2008 Sam Moffatt
- $ Added lt-LT, pl-PL and ca-ES installation language files
-
-20-Mar-2008 Ian MacLennan
- $ Added bn-IN and th-TH installation language files
-
-20-Mar-2008 Andrew Eddie
- # Fixed double-quoting bug in gacl_api::del_object
-
-15-Mar-2008 Ian MacLennan
- # [#9816] Fixed openid toggle link doesn't appear on component.  Also fixes duplicate ids for com and mod.
- # [#9816] Fixed username cannot contain + or - characters
- # [#9816] Fixed css resulting from first patch above
-
-15-Mar-2008 Sam Moffatt
- ^ Updated language XML files version to 1.5.2 and date to 2008-03-15 (pour JM)
-
-12-Mar-2008 Ian MacLennan
- # [#10156] Param for disabling the Flash Uploader
-
-11-Mar-2008 Anthony Ferrara
- # [#10077] Edit links for frontpage layout broken when not default menu item.
-
-11-Mar-2008 Wilco Jansen
- # [10129] front-end message when article submitted not translated
-
-10-Mar-2008 Wilco Jansen
- # [9971] Default parameter (global configuration) not stored in table
- # [9976] Invalid behavior after switching list length
- # [10112] Strings and tips added for 10019 editing options
- # [10124] Notice layout in milkyway is not right due to missing some css
- # [10071] Email alert for private message is confusing
-
-09-Mar-2008 Mati Kochen
- # [#10083] Upgraded TCPDF Library to v2.6
- # [#10102] Removed unneeded IF clause for ICONV usage
-
-08-Mar-2008 Andrew Eddie
- # [#10103] Additional Content Filtering
-
-07-Mar-2008 Ian MacLennan
- # [#9808] JHTMLSelect::Options dies if empty array passed
- # [#10027] When bulit a menu with catalog list which catalog has no articles, error comes out when click this menu
- # [#10055] Administrator login not possible due to unmasked querys.
-
-07-Mar-2008 Andrew Eddie
- # [#10032] JView::get() does not defer properly to JObject::get()
- # [#9641] Extra <ul /> added by mod_mainmenu in access restricted menus
- # [#10047] Size correction for some parameters pop-ups (patch)
- ^ Massmail BCC checkbox checked by default
-
-05-Mar-2008 Ian MacLennan
- # [#9817] TableUser has sendEmail set to 1 by default instead of 0, while JUser has it set to 0 by default
-
-04-Mar-2008 Anthony Ferrara
- # [#9964] lost password sends a bad link when Joomla is in a directory (Thanks Tomasz Dobrzynski)
- # [#10011] 2 Bugs in com_newsfeed
- # [#9828] Broken Links to blog items
- # [#8679] Incorrect anchors in pagination for admin template
-
-01-Mar-2008 Alan Langford
- ^ Conditional load of JLoader to support unit test.
- + Add jexit() global exit function, also for unit test.
- ^ Replace all non-environment calls to die() and exit() with jexit() (except external libs).
- ^ Make die message on no _JEXEC defined consistent throughout.
-
-29-Feb-2008 Toby Patterson
- # [#8775] Administration Toolbar translation issues
-
-29-Feb-2008 Anthony Ferrara
- # Error Log Library overwriting $date var (fatal error)
- # [#9673] Media Manager + Global paths issues
- # [#9978] Alias URLs don't work when SEF enabled
- * Sanitization of image and media paths in global config
- # Fix for date in com_messages (Thanks Jens)
-
-28-Feb-2008 Anthony Ferrara
- + JFactory::getDate
- + Support for locale based JDate override (for support of non-gregorian calendars)
- ^ Changed all calls from $date = new JDate() to $date =& JFactory::getDate();
- ^ JDate now does the translations on its own (it does not rely on setlocale()) for thread safe function.
- $ Added support for xx-XX.date.php in frontend language directories (to be used for non-gregorian calendars).
- ! all instances of JDate should now be retrieved via JFactory::getDate(); (to allow for overrides)
- # Notice with JTable::isCheckedOut when called statically
- # [#9832] [#9696] Invalid Itemid causes router to choke
- # [#7860] Cache Callback ID not reliable if callback is object
- # [#9715] Development info cached (also fixes tpl=1 case)
- # [#9421] Fix for INI parsing with | in the content
- $ [#9848] DESCNEWITEMSFIRST & LAST added to many places.
- # [#9377] Easier translation and localization
- # Upgrade TCPDF to 2.2.002 (Removes GD, libjpeg and libpng dependancies)
- # [#9968] Fix for router using default menu item vars if non-sef url passed when sef is enabled
- # [#9288] Title not escaped in link for section blog view
-
-28-Feb-2008 Wilco Jansen
- # [9946] Page title issue for contents
-
-28-Feb-2008 Sam Moffatt
- ^ Changed incorrect and misleading text in LDAP Authentication plugin
-
-28-Feb-2008 Ian MacLennan
- # [#9402] Alternative read more
- # [#9909] Newsflash Module returns incorrect SEF URL
- # [#9847] JTable::isCheckedOut() can throw an undefined method error
- # [#9912] Error in sample data
- $ [#9967] 2 missing strings in admin
- # [#7960] JFilterInput
-
-27-Feb-2008 Ian MacLennan
- # [#9648] Cache folder disapearing with legacy mode enabled
- # [#9805] bad url element for content pdf links]
-
-26-Feb-2008 Ian MacLennan
- # [#9845] com_user Login form does not offer OpenId login option
- # [#9844] created date on openid created users is invalid
- # [#8676] OpenID related untranslated strings [js]
-
-26-Feb-2008 Hannes Papenberg
- # [#9916] Saving Article Layout menu does not work
-
-25-Feb-2008 Ian MacLennan
- # [#9932] Typo in file
- # [#9907] Code cleanup com_weblinks, <button> element improperly closed
-
-25-Feb-2008Mati Kochen
- ^ [#9857] Updated TCPDF Library to support RTL - Thanks JM.
-
-23-Feb-2008 Ian MacLennan
- # [#9778] Breadcrumb includes separators
- # [#9513] Search module in rhuk_milkyway - IE6
- # [#8547] Com_media: Unable to delete files with spaces
- # [#9862] Remember me can display confusing error message.
-
-
-22-Feb-2008 Anthony Ferrara
- # Fix parse_str &amp; issues
- # [#9867] �Hardcoded strings + some errors (Thanks JM)
-
-21-Feb-2008 Ian MacLennan
- # [#9840] •Hard coded string missing translation
- # [#9579] Contact Send-Email Form Routing to Wrong Address
- # [#9739] sefRelToAbs( 'http://localhost/index.php?option=com_content&view=frontpage&Itemid=1' ) returns wrong URL
-
-20-Feb-2008 Ian MacLennan
- # [#9807] Notice error in lib/j/html/html/list.php, sign of bigger problem (thanks Jens)
-
-19-Feb-2008 Anthony Ferrara
- # [#9534] Tooltips hidden behind some tabs
- # [#8800] Changing order of articles
- # [#9708] Styling of loadmodule plugin fix.
- # [#9710] mod_feed htmlentities issues.
- # [#9758] Frontend error message for checked out content partially translated
-
-16-Feb-2008 Ian MacLennan
- # [9635] mod_random_image doesn't work as advertised
- # [8230] missing error handler on jfactory getxmlparser
-
-15-Feb-2008 Ian MacLennan
- # [#8684] Errors not correctly trapped on login
-
-14-Feb-2008 Ian MacLennan
- # [#9655] Cannot have more than 1 mootools tree on a page
-
-13-Feb-2008 Ian MacLennan
- # [#9263] Bug in com_search: incorrect highliting of multiple search words
- # [#8738] Backend Login Problems--error message not shown when frontend or blocked user attempts login
- # [#9630] Language strings missing
- # [#9636] mod_banners cannot validate as XHTML 1.0 Strict
- # [#9289] reference to wrapper url produces errors when no modules are loaded
- # [#9719] JDate->toISO8601 suggestion/correction
-
-12-Feb-2008 Ian MacLennan
- # [#9695] Invalid Token message received when trying to authenticate with OpenID
- # [#9006] Incorrect delete section message
- # [#9253] Incorrect caching time of the feed XML in mod_feed
- # [#9490] Fatal error: Call to a member function name() helper.php
- # [#8808] PDF from an article - "contributed by" isof "written by"
- # [#9555] Poll Manager poll's title sorting broken
-
-12-Feb-2008 Anthony Ferrara
- # [#9697] Khepri has type="module" instead of type="modules" for Admin Submenu (Thanks Jens)
-
-11-Feb-2008 Andrew Eddie
- $ Fixed string for XML-RPC server tip (default is no) in com_config.ini
-
-10-Feb-2008 Ian MacLennan
- # Fixed [9371] h3 Title not translated at install step4 and 5
- # Fixed [9697] Khepri has type="module" instead of type="modules" for Admin Submenu
-
-10-Feb-2008 Anthony Ferrara
- # Fixed issue with notice populating $live_site on upgrade from 1.5.0
-
-10-Feb-2008 Sam Moffatt
- # Fixed [#9381] Misnamed variable errors in migration
-
-09-Feb-2008 Ian MacLennan
- # Fixed [8602] Cookie error message in installation process
- # Fixed [9458] Email on new article - "from" is missing
- # Fixed [8368] Template preview shows only used module positions
- # Fixed [9434] Sample data: Two Resource Modules
- # Fixed [9690] Version number in administrator backend shows 1.5.0
- # Fixed [9312] Pre-installation Check wrongly recommends Display Errors ON
- # Fixed [9408] Articles don't change if you change a category to another section
-
-
--------------------- 1.5.1 Stable Release [8-February-2008] ---------------------
-
-05-Feb-2008 Anthony Ferrara
- # Fixed [9552] Added missing DOMMIT files
- # Fixed [9620] When trying to login, the site returns 'Invalid Token'
- # Added live_site parameter to config, and JURI::base override (fixes SEF and proxy issues)
-
-05-Feb-2008 Ian MacLennan
- # Fixed [9512] Removed superfluous references to JUser
- # Fixed [9596] Incorrect language string in Beez
- # Fixed [9257] Fixed comments in index.php and administrator/index.php
- # Fixed [9399] XMLRPC Blogger more_text tag problem
- * Fixed [9406] XMLRPC Blogger API
-
-05-Feb-2008 Andrew Eddie
- # Turned XML-RPC server off by default
-
-04-Feb-2008 Wilco Jansen
- # Fixed [9111] error.php contains a relative url to Home Page (Thanks Jens)
- # Fixed [9516] Links in archive module don't work with SEF (Thanks Jens)
- # Fixed [9211] Installation always falling back to joomla_backwards.sql (Thanks Jens)
-
-01-Feb-2008 Ian MacLennan
- # Fixed [#9320] Problem with allowing HTML in requests [patch] (Thanks Jens)
-
-01-Feb-2008 Anthony Ferrara
- * Fixed remote execution vulnerability in phpmailer
- # [#6730] batchQuery() Bug: Broken splitting function
- # [#8776] Mass Email BCC option (Thanks JM)
-
-30-Jan-2008 Anthony Ferrara
- # Fixed htaccess instructions (refering to a second section that was removed)
- # [topic,257873] Fixed possible notice with com_content router
- # [#9518] When creating menu item for a poll, you cannot select poll (Thanks Ian MacLennan)
- # [#9383] Search for contacts generates bad links (Thanks Jens-Christian Skibakk)
- # [#9426] PopUp Url link broken
-
-29-Jan-2008 Ian MacLennan
- # Fixed [#9342] Poll goes 404 after voting - fixed redirect URL.
-
-28-Jan-2008 Anthony Ferrara
- # Fixed memcache session driver config param loading (changed it to work like cache driver)
- # [#9225] Typo in joomla_backwards.sql (Thanks Jens-Christian Skibakk)
- # [#8823] Modules don't show up when eAccelerator is enabled (Thanks Dalibor Karlovic)
-
-28-Jan-2008 Robin Muilwijk
- # Fixed [#9472] Session not cleared properly
- # Fixed [#9291] Error in call method
- # Fixed [#9251] Additional double quote in weblink's template
- # Fixed [#8173] Problem with preg_quote in function utf8_ireplace
-
-27-Jan-2008 Wilco Jansen
- ^ Remove the installation check
- # [9401] Help in backend showind 404 [Patch], thanks Jens-Christian Skibakk for the patch
- # [9412] publish_down is initialized to 1970 in some environments, thanks Kevin for the patch
-
--------------------- 1.5.0 Stable Release [21-January-2008] ---------------------
-
-21-Jan-2008 Rob Schley
- ^ Updated COPYRIGHT.php to reference the new, consolidated CREDITS.php
- + Added LICENSES.php which will hold full text versions of other licenses.
-
-17-Jan-2008 Anthony Ferrara
- + [8987] [8986] Added 3 Language strings to com_user and com_installer's language files (Thanks JM)
- # [9285] Administrators not being able to edit their own profile or change password
-
-16-Jan-2008 Anthony Ferrara
- # Fixed session issues with Invalid Token randomly appearing
- # Fixed [9255] Error with Pagination and SEF (Thanks Jenscski)
-
-15-Jan-2008 Wilco Jansen
- + Added language af-ZA and ar-DZ
-
-15-Jan-2008 Andrew Eddie
- ^ Encapsulated public/non-public token logic into JUtility::getToken
-
-14-Jan-2008 Wilco Jansen
- # Fixed [8874] Apostrophes transformed in html entities for page titles
- # Fixed [8673] Wrong encoding for "login redirection url" in user login parameters
- ^ Changed fa-IR langiage pack
- + Added tr-TR langiage pack
- ! Patch for 8874 and 8673 provided by Kevin Devine
-
-14-Jan-2008 Andrew Eddie
- # Fixed inconsistend SQL in backward compat file (#__core_acl_aro_sections.section_id renamed to #__core_acl_aro_sections.id)
-
-13-Jan-2008 Anthony Ferrara
- * [8739] Block user issues in administrator fix
- * [topic,252372] Security fix in com_users
- # [9126] [8702] Fixes for imagepath problems in categories:w
- # Fixed language issues
- # Added default alias for all items in core
-
-12-Jan-2008 Wilco Jansen
- # Fixed [9194] No _JEXEC check in bigdump causes information disclosure if called directly
-
-12-Jan-2008 Ian MacLennan
- # Fixed SEF issue for com_newsfeeds.
- # Removed incorrect line endings from some language files.
- # Fixed issue with page cache caching tokens.
-
-11-Jan-2008 Ian MacLennan
- # Fixed SEF issue for com_poll, com_wrapper and com_search
-
-11-Jan-2008 Wilco Jansen
- # Fixed [9032] cannot upload image
- # Fixed [9161] Media Manager - uploads doesn't work with flash tool
- ! Patch provided by Kevin Devine, thanks Kevin!
- ^ Changes language files for hr-HR, lt-LT, ro-RO, ru-RU
- + Added language files for eu-ES, hi-IN
-
-11-Jan-2008 Ian MacLennan
- # Fixed bug in search where small words were not being filtered out properly
- # Fixed problem in search with regex using too many resources (related to above)
- # Fixed [#8404] Incorrect highlighting of search terms (as a byproduct)
-
-10-Jan-2008 Sam Moffatt
- # Fixed error in backlink migration plugin
- # Fixed error with category/section search in front end
- # Fixed error with weblink search in back end
- # Fixed error with Legacy SEF incorrectly returning 404 page not found error
-
-09-Jan-2008 Andy Miller
- # Fixed issues with pillmenu in both LTR and RTL directions
-
-09-Jan-2008 Ian MacLennan
- # Fixed issue with incorrect building of section links in content router
-
-07-Jan-2008 Johan Janssens
- # Fixed issue with JApplication::route wrongly assuming no route was found if no request variables are
-   being returned and throwing a 404.
-
-07-Jan-2008 Andrew Eddie
- # Changed form tokens to display different public and logged in values
-
-05-Jan-2008 Rob Schley
- # Refactored routers for com_contact, com_weblinks, com_polls, and com_newsfeeds to be more reliable
-   at finding configurations and to prevent duplicate content URL issues.
-
-05-Jan-2008 Louis Landry
- # Fixed [#8228] Empty categories don't display when the show empty category parameter is selected (proposed solution)
- # Fixed [#8301] Memory consumption problems in com_search
- # Fixed [#8432] Mod_polls Validation: JS Unterminated String Literal--problems with quote marks in alias
- # Fixed [#8532] alias fields on menus and com_pool is not correctly sanitized can break links when sef on and cause other errors
-
-05-Jan-2008 Charl van Niekerk
- # Fixed pagination in backend com_weblinks (similar issue as [#8718])
- # Fixed division by zero in com_weblinks frontend and backend if limit = 0
-
-05-Jan-2008 Anthony Ferrara
- # [#8663] File path issues in media manager for IE6 and IE7 (Thanks Jens-Christian Skibakk)
- # [#8452] Mediamanager in IE6 shows one item in each row (Thanks Michal Sobkowiak)
- ^ Fix for pt-PT installation translation file error (from Translation team)
-
-05-Jan-2008 Mati Kochen
- + Added missing POLL string
- - Removed unnecessary "
- ^ fixed locales again
- # [topic,249218] notice when showing subtree with no active parent (thanks trevornorth)
-
-05-Jan-2008 Wilco Jansen
- ^ Updated the installer language files (thanks Ole for providing, thanks translators for creating these files)
- # Fixed [9019] Content of entryfield 'Style' of 'Image' -> 'Appearances' are not saved in Article Editor (Thanks Bruce Scherzinger)
- ! Make sure to save the plugin properties once of the tinymce editor!
-
-05-Jan-2008 Andrew Eddie
- * SECURITY - Hardened escaping of user supplied text strings used in LIKE queries
- ^ Added extra arguments to JDatabase::Quote and JDatabase::getEscaped to facilitate hardening queries
- # Fixed [#8988] Legacy commonhtml.php bug
- # Fixed missing token in offline page
-
-04-Jan-2008 Charl van Niekerk
- # Fixed pagination in backend com_content (similar issue as [#8718])
-
-04-Jan-2008 Louis Landry
- # Fixed JDate issue with server offsets and daylight savings time as well as GMT output
-
-04-Jan-2008 Jui-Yu Tsai
- # Fixed com_messages manager reset filter
-
-04-Jan-2008 Mati Kochen
- ^ [topic,249292] Minor Typos in Sample Data
- # [topic,249199] Added 404 if no Route was found
-
-04-Jan-2008 Alan Langford
- ^ Removed conditionals in loader.php, to revisit after upcoming release.
-
-03-Jan-2008 Jui-Yu Tsai
- # Fixed [#8615][topic,240577] mod_newsflash "Read more..." parameter issue
- # Fixed [topic,248718] com_search gives an error under Beez template
- # Fixed [topic,248716] Author and date in beez template
-
-03-Jan-2008 Anthony Ferrara
- # Fixed untranslated string in timezones (Thanks Ercan �zkaya)
-
-03-Jan-2008 Andrew Eddie
- # Added JHTML::_( 'form.token' ) and JRequest::checkToken to assist in preventing CSRF exploits
-
-03-Jan-2008 Alan Langford
- ^ Added conditionals to JLoader, __autoload(), jimport() to aid unit testing.
-
-02-Jan-2008 Mati Kochen
- ^ Added UTF locales to en_GB.xml (admin/installation/site)
-
-02-Jan-2008 Andrew Eddie
- # Fixed CSRF exploits in com_installer
-
-02-Jan-2008 Toby Patterson
- # Fixed problem with JDocumentRendererAtom encoding links resulting in invalid urls ( & to &amp; )
-
-02-Jan-2008 Robin Muilwijk
- # Fixed [#8969] Mod_sections missing parameter + patch
- # Fixed [#8828] htaccess does not include rewrite for .htm
-
-02-Jan-2008 Sam Moffatt
- # Fixed radio button selection in com_installer
- ^ Removed administration/media tag from module installer
-
-01-Jan-2008 Chris Davenport
- ^ Local help files replaced by dummy files containing links to online help.
-
-01-Jan-2008 Johan Janssens
- ^ Changed JHTML::_() to support variable prefixes, type can now be prefix.class.function
-
-01-Jan-2008 Wilco Jansen
- ^ Added also front-end language defaulting, see also #8307
-
-01-Jan-2008 Mati Kochen
- # [#8750] Fixed Base URL sent by reminder mail
-
-01-Jan-2008 Sam Moffatt
- ! Welcome to 2008, a great new year for Joomla!
- ^ Updates to the installation system to better handle some situations
- ^ Renamed a variable in the Joomla authentication plugin to make more sense
- # Fixes to prevent against uninitialised variable access in various locations
-
-31-Dec-2007 Mati Kochen
- ^ [topic,247978] Added More Articles string, with corresponding fixes in files
- # [#8935] wrong comparisson for categories
-
-31-Dec-2007 Charl van Niekerk
- # Fixed [#8516] xmlrpc throws errors when using third party blog/content entry tools
- ^ Changed mod_breadcrumbs individual module include to "breadcrumb" position include in rhuk_milkyway and beez
- ^ Renamed "breadcrumbs" position to "breadcrumb" in rhuk_milkyway
-
-31-Dec-2007 Johan Janssens
- + Added scope variable to JApplication
-
-30-Dec-2007 Wilco Jansen
- # Fixed [8307] Local distribs can't define default admin language
-
-30-Dec-2007 Charl van Niekerk
- # Fixed [#8718] Frontend com_weblinks pagination error
-
-30-Dec-2007 Mati Kochen
- # [#8568] Applied proposed fixes
- # [#8797] Added string to com_installer
- # [#7549] type of uninstall not translated
- # [#8901] changed copyright to 2008
-
-30-Dec-2007 Anthony Ferrara
- ^ [#8901] Update copyright date needed in all trunk files
- # [#8736] 'limit' form field ignored in com_search
- ^ Added Istanbul to the timezone listings (Thanks Ercan �zkaya)
-
-29-Dec-2007 Andy Miller
- # Fixed issue with admin login button with Safari
-
-29-Dec-2007 Hannes Papenberg
- # [#8688] fixed pagination in com_categories
-
-29-Dec-2007 Johan Janssens
- + Added transliterate function to JLanguage
- ^ JFilterOutput::stringURLSafe now calls JLanguage::transliterate
-
-29-Dec-2007 Anthony Ferrara
- # [#8690] javascript popup: url not found (images directory incorrect)
-
-29-Dec-2007 Mati Kochen
- ^ change width from 1000px to 960px (khepri)
- # [#8873] added BROWSE string
- # [#8867] fixed (Today) string
- # [#8576] added UNINSTALLLANGPUBLISHEDALREADY to com_installer with the correct call
-
-28-Dec-2007 Hannes Papenberg
- # Fixed [#8229] If Intro Text is set to hide and no Fulltext is available, Intro Text is used as the fulltext
-
-27-Dec-2007 Wilco Jansen
- ! Forgotten to credit Zinho for supplying us with information about the csrf exploit that was fixed
-   during PBF weekend. Thanks Zinho for you issue report.
-
-27-Dec-2007 Chris Davenport
- ^ Removed/renamed redundant local help screens.
-
-26-Dec-2007 Nur Aini Rakhmawati
-# Fixed [#6111] New button act as Edit when multiply select in Menu Item Manager
-# Fixed [t,223403] Warning menu manager standardization for cancel button
-
-25-Dec-2007 Nur Aini Rakhmawati
- # Fixed [#8557] language typo and ordering languange list (Thanks to Ole Bang Ottosen)
-
-24-Dec-2007 Anthony Ferrara
- # Fixed [#8754] issue with SEF plugin rewriting raw anchors (Thanks Jens-Christian Skibakk)
-
-24-Dec-2007 Jui-Yu Tsai
- # Fixed [#8568] language typo
-
-23-Dec-2007 Rob Schley
- # Fixed JRegistryFormatINI::objectToString() method to build proper arrays again. Thanks Ian for testing.
- # Fixed view cache handler not storing module buffer.
- # Fixed JDocumentHTML::getBuffer() so that you can access the entire document buffer.
-
-23-Dec-2007 Nur Aini Rakhmawati
- # Fixed [#8168] Removed Redundant code in Published Section. Thanks Alaattin Kahramanlar
-
-22-Dec-2007 Johan Janssens
- + Added $params parameter to JEditor::display function. This allows to programaticaly set or override
-   the editor plugin parameters.
-
-22-Dec-2007 Andrew Eddie
- ^ Moved article edit icon into the print|pdf|email area
- + Added type property to JAuthenticationResponse which is set to the successful authenication method
- ^ Split diff.sql into steps for RC's
-
-21-Dec-2007 Mati Kochen
- ^ [topic,245507] Better Styling with double classes & easier RTL
-
-21-Dec-2007 Anthony Ferrara
- # [#8678] [#8675] [#8648] [topic,245507] Fixed min-width CSS issue forcing scrollbars
-
-21-Dec-2007 Andrew Eddie
- # Fixed [topic,245313] Fatal error in Menu Manager when editing an item
- ! Lots of cosmetic commits (remove trailing ?> tags at EOF, white space, etc)
-
-20-Dec-2007 Jui-Yu Tsai
- # [topic,245322] fixed missing "s" at string for more than one unit
-
-20-Dec-2007 Mickael Maison
- # [#7617] Untranslated error message during authentication
-
-20-Dec-2007 Mati Kochen
- ^ [topic,244583] added $rows = $this->items, and replaced all instaces
- ^ [topic,244213] added limitation to the return pagination only when there is one
- ^ [topic,244895] added missing content display
- ^ [topic,245291] refactor more links to use ContentHelperRoute
-
-20-Dec-2007 Ian MacLennan
- # Fixed Topic 245155 Category Content Filter missing default parameter values in model
-
-20-Dec-2007 Sam Moffatt
- # [#8444] Testing migration script on install - Scripts not executing (added display of current max PHP upload)
- # [#8517] com_installer: Installing from nonexisting URL generates technical error message
- ! SERVER_CONNECT_FAILED language added to com_installer
- ! MAXIMUM UPLOAD SIZE and UPLOADFILESIZE added to installation language
- # [#8628] Extension installer fails to remove media files (proposed solution)
- # [#8573] Google stuff still present in com_search
-
-20-Dec-2007 Andrew Eddie
- # Fixed [t,243324] PHP 4 incompatible syntax in ContentModelArchive::_getList
- # Fixed extra <span> in Content Archive items layout
- # Fixed [#8667] bug in JDate
-
-19-Dec-2007 Ian MacLennan
- # Fixed Content Router swallows up layout (checks to see if it matches Itemid)
-
-19-Dec-2007 Ian MacLennan
- # Fixed topic 244449 XMLRPC Search plugin doesn't work with weblinks search plugin published
-
--------------------- 1.5.0 Release Candidate 4 Released [19-December-2007] ---------------------
diff -aruN --binary 21/components/com_contact/views/category/view.html.php 22/components/com_contact/views/category/view.html.php
--- 21/components/com_contact/views/category/view.html.php	2010-07-18 05:15:44.000000000 +0200
+++ 22/components/com_contact/views/category/view.html.php	2010-11-03 19:12:02.000000000 +0100
@@ -1,6 +1,6 @@
 <?php
 /**
- * @version		$Id: view.html.php 18162 2010-07-16 07:00:47Z ian $
+ * @version		$Id: view.html.php 19343 2010-11-03 18:12:02Z ian $
  * @package		Joomla
  * @subpackage	Contact
  * @copyright	Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
@@ -50,6 +50,10 @@
 			$filter_order = 'cd.ordering';
 		}
 
+		if (!in_array(strtoupper($filter_order_Dir), array('ASC', 'DESC', ''))) {
+			$filter_order_Dir = 'ASC';
+		}
+
 		// query options
 		$options['aid'] 		= $user->get('aid', 0);
 		$options['category_id']	= $categoryId;
diff -aruN --binary 21/components/com_content/models/archive.php 22/components/com_content/models/archive.php
--- 21/components/com_content/models/archive.php	2010-04-23 13:40:12.000000000 +0200
+++ 22/components/com_content/models/archive.php	2010-11-03 19:12:02.000000000 +0100
@@ -1,6 +1,6 @@
 <?php
 /**
- * @version		$Id: archive.php 14401 2010-01-26 14:10:00Z louis $
+ * @version		$Id: archive.php 19343 2010-11-03 18:12:02Z ian $
  * @package		Joomla
  * @subpackage	Content
  * @copyright	Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
@@ -134,8 +134,17 @@
 		$filter_order		= JRequest::getCmd('filter_order');
 		$filter_order_Dir	= JRequest::getWord('filter_order_Dir');
 
+		if (!in_array($filter_order, array('a.id', 'a.title', 'a.alias', 'a.title_alias', 'a.introtext', 'a.sectionid', 'a.state', 'a.catid',
+			'a.created', 'a.created_by', 'a.created_by_alias', 'a.modified', 'a.modified_by', 'a.hits', 'a.ordering', 'cc.title', 's.title'))) {
+			$filter_order = '';
+		}
+
+		if (!in_array(strtoupper($filter_order_Dir), array('ASC', 'DESC'))) {
+			$filter_order_Dir = '';
+		}
+
 		$orderby = ' ORDER BY ';
-		if ($filter_order && $filter_order_Dir) {
+		if ($filter_order) {
 			$orderby .= $filter_order.' '.$filter_order_Dir.', ';
 		}
 
diff -aruN --binary 21/components/com_content/models/category.php 22/components/com_content/models/category.php
--- 21/components/com_content/models/category.php	2010-04-23 13:40:12.000000000 +0200
+++ 22/components/com_content/models/category.php	2010-11-03 16:00:56.000000000 +0100
@@ -1,6 +1,6 @@
 <?php
 /**
- * @version		$Id: category.php 15201 2010-03-05 09:15:01Z ian $
+ * @version		$Id: category.php 19340 2010-11-03 15:00:55Z ian $
  * @package		Joomla
  * @subpackage	Content
  * @copyright	Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
@@ -330,6 +330,13 @@
 
 			$query = $this->_buildQuery();
 			$Arows = $this->_getList($query, $limitstart, $limit);
+			
+			// Check for db errors
+			if ($this->_db->getErrorNum())
+			{
+				JError::raiseError(500, $this->_db->stderror());
+				return false;
+			}
 
 			// special handling required as Uncategorized content does not have a section / category id linkage
 			$i = $limitstart;
@@ -382,6 +389,15 @@
 		$itemid = JRequest::getInt('id', 0) . ':' . JRequest::getInt('Itemid', 0);
 		$filter_order  = $mainframe->getUserStateFromRequest('com_content.category.list.' . $itemid . '.filter_order', 'filter_order', '', 'cmd');
 		$filter_order_Dir = $mainframe->getUserStateFromRequest('com_content.category.list.' . $itemid . '.filter_order_Dir', 'filter_order_Dir', '', 'cmd');
+
+		if (!in_array($filter_order, array('a.title', 'author', 'a.hits', 'a.created', 'a.publish_up', 'a.publish_down', 'a.modified'))) {
+			$filter_order = '';
+		}
+
+		if (!in_array(strtoupper($filter_order_Dir), array('ASC', 'DESC'))) {
+			$filter_order_Dir = 'ASC';
+		}
+
 		$orderby = ' ORDER BY ';
 		if ($filter_order && $filter_order_Dir)
 		{
diff -aruN --binary 21/components/com_content/models/section.php 22/components/com_content/models/section.php
--- 21/components/com_content/models/section.php	2010-04-23 13:40:12.000000000 +0200
+++ 22/components/com_content/models/section.php	2010-11-03 19:12:02.000000000 +0100
@@ -1,6 +1,6 @@
 <?php
 /**
- * @version		$Id: section.php 14401 2010-01-26 14:10:00Z louis $
+ * @version		$Id: section.php 19343 2010-11-03 18:12:02Z ian $
  * @package		Joomla
  * @subpackage	Content
  * @copyright	Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
@@ -341,6 +341,14 @@
 			$query = $this->_buildQuery();
 			$Arows = $this->_getList($query, $limitstart, $limit);
 
+			// Check for db errors
+			if ($this->_db->getErrorNum())
+			{
+				JError::raiseError(500, $this->_db->stderror());
+				return false;
+			}
+			
+
 			// special handling required as Uncategorized content does not have a section / category id linkage
 			$i = $limitstart;
 			$rows = array();
@@ -433,8 +441,18 @@
 		$filter_order		= JRequest::getCmd('filter_order');
 		$filter_order_Dir	= JRequest::getWord('filter_order_Dir');
 
+		if (!in_array($filter_order, array('a.id', 'a.title', 'a.alias', 'a.title_alias', 'a.introtext', 'a.fulltext', 'a.sectionid', 'a.state',
+			'a.catid', 'a.created', 'a.created_by', 'a.created_by_alias', 'a.modified', 'a.modified_by', 'a.checked_out', 'a.checked_out_time',
+			'a.hits', 'a.ordering', 'a.metakey', 'a.access'))) {
+			$filter_order = 'a.ordering';
+		}
+
+		if (!in_array(trim(strtoupper($filter_order_Dir)), array('ASC', 'DESC'))) {
+			$filter_order_Dir = 'ASC';
+		}
+
 		$orderby = ' ORDER BY ';
-		if ($filter_order && $filter_order_Dir) {
+		if ($filter_order) {
 			$orderby .= $filter_order .' '. $filter_order_Dir.', ';
 		}
 
diff -aruN --binary 21/components/com_weblinks/models/category.php 22/components/com_weblinks/models/category.php
--- 21/components/com_weblinks/models/category.php	2010-04-23 13:40:14.000000000 +0200
+++ 22/components/com_weblinks/models/category.php	2010-11-03 19:12:02.000000000 +0100
@@ -1,6 +1,6 @@
 <?php
 /**
- * @version		$Id: category.php 14401 2010-01-26 14:10:00Z louis $
+ * @version		$Id: category.php 19343 2010-11-03 18:12:02Z ian $
  * @package		Joomla
  * @subpackage	Content
  * @copyright	Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
@@ -81,9 +81,20 @@
 		// In case limit has been changed, adjust limitstart accordingly
 		$this->setState('limitstart', ($this->getState('limit') != 0 ? (floor($this->getState('limitstart') / $this->getState('limit')) * $this->getState('limit')) : 0));
 
+		$filter_order = JRequest::getCmd('filter_order', 'ordering');
+		$filter_order_Dir = JRequest::getCmd('filter_order_Dir', 'ASC');
+
+		if (!in_array($filter_order, array('title', 'hits', 'ordering'))) {
+			$filter_order = 'ordering';
+		}
+
+		if (!in_array(strtoupper($filter_order_Dir), array('ASC', 'DESC', ''))) {
+			$filter_order_Dir = 'ASC';
+		}
+
 		// Get the filter request variables
-		$this->setState('filter_order', JRequest::getCmd('filter_order', 'ordering'));
-		$this->setState('filter_order_dir', JRequest::getCmd('filter_order_Dir', 'ASC'));
+		$this->setState('filter_order', $filter_order);
+		$this->setState('filter_order_dir', $filter_order_Dir);
 
 		$id = JRequest::getVar('id', 0, '', 'int');
 		$this->setId((int)$id);
diff -aruN --binary 21/CREDITS.php 22/CREDITS.php
--- 21/CREDITS.php	2010-07-18 05:15:44.000000000 +0200
+++ 22/CREDITS.php	2010-11-02 14:49:14.000000000 +0100
@@ -1,6 +1,6 @@
 <?php
 /**
- * @version		$Id: CREDITS.php 18151 2010-07-15 09:33:47Z dextercowley $
+ * @version		$Id: CREDITS.php 19327 2010-11-02 13:49:13Z infograf768 $
  * @package		Joomla
  * @copyright	Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
  * @license		GNU/GPL, see LICENSE.php
@@ -69,7 +69,6 @@
 Albanian (sp-AL) - Blendi Kraja
 Arabic Unitag (ar-AA) - Arabic Unitag Translation Team - Mahmood Alhaj Kassem
 Azeri (az-AZ) - Azeri Translation Team - Mahmud and Yusif
-Basque (eu-ES) - Basque Translation Team (Basque Language School of Santurtzi) - Abel Camacho, Pedro Lonbide
 Belarusian (be-BY) - Dennis Hermacki
 Bengali (bn-BD) – Kamal Sikder
 Bosnian (bs-BA) - Bosnian Translation Team - Admir Agic
@@ -90,7 +89,6 @@
 German (de-DE)/(de-CH)/(de-AT) - J!German - Jan Erik Zassenhaus, Karin Nikolaj, David Jakob, Antonio Cambule\
 Greek (el-GR) - Greek Joomla Community - Aris Ntatsis
 Gujarati (gu-IN) - Gujarati Translation Team
-Hebrew (he-IL) - Joomla!Hebrew - Mati (MtK) Kochen
 Hindi (India) (hi-IN) - Hindi (India) Translation Team - Sanjeev Naroliya, Ronak Bhagdev, Aminuddin Sheikh
 Hungarian (hu-HU) - Magyar Joomla! Felhasznalok Nemzetkozi Egyesulete - Jozsef Tamas Herczeg, Annamaria Ban
 Icelandic (is-IS) - Joomlis! Icelandic Joomla Community [joomlis.net] - Magnús Guðlaugsson
@@ -106,16 +104,16 @@
 Norwegian bokmål (nb-NO) - Joomla! i Norge - Jens-Christian Skibakk, Rune Rasmussen
 Pashto (Afghanistan) (ps-AF) - Pashto (Afghanistan) Translation Team - Daud Nigaresh
 Persian/Farsi (fa-IR) - Joomfa Team(Joomla Farsi) - M.Alavi nik, Hamid abolhasani,Amin bagheri,Sayyed Saeed farzad,Sayyed ahmad sayyedi,Vahid Hosein Khani,Omid pileh var
-Polish - Poland (pl-PL) - Polskie Centrum Joomla! - Michał Sobkowiak, Stefan Wajda
+Polish - Poland (pl-PL) - Polskie Centrum Joomla! - Stefan Wajda
 Portuguese Brazilian (pt-BR) - Joomla! Brasil - Fabricio Elias Costa (FaBMak)
 Portuguese (pt-PT) - Joomla! Portugal - Paulo Izidoro
 Romanian (ro-RO) - Romanian Joomla! Community - Cosmin Lebu
 Russian (ru-RU) - Russian Translation Team - Serge Litvinov
-Serbian (sr-RS) - Joomla! Serbia team - Marko Milenovic
-Serbian (sr-YU) - Joomla! Serbia team - Svetlana Zec, Marko Milenovic
+Serbian (sr-RS) - Joomla! Serbia team - Svetlana Zec
+Serbian (sr-YU) - Joomla! Serbia team - Svetlana ZecSvetlana Zec
 Sindhi (sd-PK) - Raheel H. Kaghzi, Shafiq-ur-rehman Khatri
 Sinhala (si-LK) - Rashan Anushka
-Slovak (sk-SK) - Slovak Translation Team - Karol Cejka, Viliam Kmec, Alexander Horvath, Marek Sabo
+Slovak (sk-SK) - Karol Cejka
 Slovenian (sl-SI) - Slovenian Translation Team - Borut Planinc
 Spanish (es-ES) - Joomla!'s Spanish Community Translation Team - Javier Galasse
 Swedish (sv-SE) - Swedish Translation Team (SvenskJoomla!) - Sune Hultman, Christer Gerhardsson
diff -aruN --binary 21/libraries/joomla/factory.php 22/libraries/joomla/factory.php
--- 21/libraries/joomla/factory.php	2010-04-23 13:40:18.000000000 +0200
+++ 22/libraries/joomla/factory.php	2010-10-21 04:06:40.000000000 +0200
@@ -1,6 +1,6 @@
 <?php
 /**
- * @version		$Id: factory.php 15184 2010-03-04 23:18:17Z ian $
+ * @version		$Id: factory.php 19176 2010-10-21 03:06:39Z ian $
  * @package		Joomla.Framework
  * @copyright	Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
  * @license		GNU/GPL, see LICENSE.php
@@ -563,6 +563,7 @@
 		$db =& JDatabase::getInstance( $options );
 
 		if ( JError::isError($db) ) {
+			header('HTTP/1.1 500 Internal Server Error');
 			jexit('Database Error: ' . $db->toString() );
 		}
 
diff -aruN --binary 21/libraries/joomla/filesystem/file.php 22/libraries/joomla/filesystem/file.php
--- 21/libraries/joomla/filesystem/file.php	2010-04-23 13:40:18.000000000 +0200
+++ 22/libraries/joomla/filesystem/file.php	2010-10-21 04:08:56.000000000 +0200
@@ -1,9 +1,9 @@
 <?php
 /**
- * @version		$Id: file.php 14401 2010-01-26 14:10:00Z louis $
+ * @version		$Id: file.php 19177 2010-10-21 03:08:56Z ian $
  * @package		Joomla.Framework
  * @subpackage	FileSystem
- * @copyright	Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
+ * @copyright	Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.
  * @license		GNU/GPL, see LICENSE.php
  * Joomla! is free software. This version may have been modified pursuant
  * to the GNU General Public License, and as distributed it includes or
@@ -35,8 +35,14 @@
 	 * @since 1.5
 	 */
 	function getExt($file) {
-		$dot = strrpos($file, '.') + 1;
-		return substr($file, $dot);
+		$chunks = explode('.', $file);
+		$chunksCount = count($chunks) - 1;
+
+		if($chunksCount > 0) {
+			return $chunks[$chunksCount];
+		}
+		
+		return false;
 	}
 
 	/**
diff -aruN --binary 21/libraries/joomla/filter/filterinput.php 22/libraries/joomla/filter/filterinput.php
--- 21/libraries/joomla/filter/filterinput.php	2010-07-18 05:15:44.000000000 +0200
+++ 22/libraries/joomla/filter/filterinput.php	2010-11-03 15:52:38.000000000 +0100
@@ -1,6 +1,6 @@
 <?php
 /**
- * @version		$Id: filterinput.php 18162 2010-07-16 07:00:47Z ian $
+ * @version		$Id: filterinput.php 19339 2010-11-03 14:52:38Z ian $
  * @package		Joomla.Framework
  * @subpackage	Filter
  * @copyright	Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
@@ -175,9 +175,9 @@
 				$lang = &JFactory::getLanguage();
 				$result = $lang->transliterate($result);
 				$result = (string) preg_replace(
-					array('/\s+/','/[^A-Za-z0-9\-\_]/'), array('-',''), $result
+					array('/\s+/','/[^A-Za-z0-9\-\_ ]/'), array('-',''), $result
 				);
-				$result = strtolower(trim($result));
+				$result = trim($result);
 				break;
 
 
diff -aruN --binary 21/libraries/joomla/session/session.php 22/libraries/joomla/session/session.php
--- 21/libraries/joomla/session/session.php	2010-04-23 13:40:18.000000000 +0200
+++ 22/libraries/joomla/session/session.php	2010-11-03 15:51:56.000000000 +0100
@@ -1,6 +1,6 @@
 <?php
 /**
-* @version		$Id: session.php 16385 2010-04-23 10:44:15Z ian $
+* @version		$Id: session.php 19338 2010-11-03 14:51:55Z ian $
 * @package		Joomla.Framework
 * @subpackage	Session
 * @copyright	Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
@@ -507,40 +507,7 @@
 			// @TODO :: generated error here
 			return false;
 		}
-
-		// save values
-		$values	= $_SESSION;
-
-		// keep session config
-		$trans	=	ini_get( 'session.use_trans_sid' );
-		if( $trans ) {
-			ini_set( 'session.use_trans_sid', 0 );
-		}
-		$cookie	=	session_get_cookie_params();
-
-		// create new session id
-		$id	=	$this->_createId( strlen( $this->getId() ) );
-
-		// first we grab the session data
-		$data = $this->_store->read($this->getId());
-
-		// kill session
-		session_destroy();
-
-		// re-register the session store after a session has been destroyed, to avoid PHP bug
-		$this->_store->register();
-
-		// restore config
-		ini_set( 'session.use_trans_sid', $trans );
-		session_set_cookie_params( $cookie['lifetime'], $cookie['path'], $cookie['domain'], $cookie['secure'] );
-
-		// restart session with new id
-		session_id( $id );
-		session_start();
-		$_SESSION = $values;
-
-		//now we put the session data back
-		$this->_store->write($id, $data);
+		session_regenerate_id();
 		return true;
 	}
 
diff -aruN --binary 21/libraries/joomla/version.php 22/libraries/joomla/version.php
--- 21/libraries/joomla/version.php	2010-10-08 07:39:10.000000000 +0200
+++ 22/libraries/joomla/version.php	2010-11-03 16:00:56.000000000 +0100
@@ -1,6 +1,6 @@
 <?php
 /**
- * @version		$Id: version.php 19058 2010-10-08 04:15:39Z dextercowley $
+ * @version		$Id: version.php 19340 2010-11-03 15:00:55Z ian $
  * @package	Joomla.Framework
  * @copyright	Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
  * @license		GNU/GPL, see LICENSE.php
@@ -26,13 +26,13 @@
 	/** @var string Development Status */
 	var $DEV_STATUS = 'Stable';
 	/** @var int Sub Release Level */
-	var $DEV_LEVEL 	= '21';
+	var $DEV_LEVEL 	= '22';
 	/** @var int build Number */
 	var $BUILD	= '';
 	/** @var string Codename */
-	var $CODENAME 	= 'senu takaa ama wepulai';
+	var $CODENAME 	= 'senu takaa ama woi';
 	/** @var string Date */
-	var $RELDATE 	= '08-October-2010';
+	var $RELDATE 	= '04-November-2010';
 	/** @var string Time */
 	var $RELTIME 	= '18:00';
 	/** @var string Timezone */
