english/libraries/joomla/updater/update.php
/**
	 * Callback for closing the element
	 *
	 * @param   object  $parser  Parser object
	 * @param   string  $name    Name of element that was closed
	 *
	 * @return  void
	 *
	 * @note This is public because it is called externally
	 * @since  11.1
	 */
Callback for closing the element
@param   object  $parser  Parser object
@param   string  $name    Name of element that was closed

@return  void

@note This is public because it is called externally
@since  11.1
Callback for closing the element @param object $parser Parser object @param string $name Name of element that was closed @return void @note This is public because it is called externally @since 11 . 1
public function _endElement($parser, $name)
	{
		array_pop($this->_stack);
		switch($name)
		{
			case 'UPDATE':
				$ver = new JVersion;
				$product = strtolower(JFilterInput::getInstance()->clean($ver->PRODUCT, 'cmd'));
				if($product == $this->_current_update->targetplatform->name && $ver->RELEASE == $this->_current_update->targetplatform->version)
				{
					if(isset($this->_latest))
					{
						if(version_compare($this->_current_update->version->_data, $this->_latest->version->_data, '>') == 1) {
							$this->_latest = $this->_current_update;
						}
					}
					else {
						$this->_latest = $this->_current_update;
					}
				}
				break;
			case 'UPDATES':
				if(isset($this->_latest))
				{
					foreach(get_object_vars($this->_latest) as $key=>$val) {
						$this->$key = $val;
					}
					unset($this->_latest);
					unset($this->_current_update);
				}
				else if(isset($this->_current_update))
				{
					unset($this->_current_update);
				}
				break;
		}
	}
public function _endElement ( $ parser , $ name ) { array_pop ( $ this -> _stack ) ; switch ( $ name ) { case 'UPDATE' : $ ver = new JVersion ; $ product = strtolower ( JFilterInput :: getInstance ( ) -> clean ( $ ver -> PRODUCT , 'cmd' ) ) ; if ( $ product == $ this -> _current_update -> targetplatform -> name && $ ver -> RELEASE == $ this -> _current_update -> targetplatform -> version ) { if ( isset ( $ this -> _latest ) ) { if ( version_compare ( $ this -> _current_update -> version -> _data , $ this -> _latest -> version -> _data , '>' ) == 1 ) { $ this -> _latest = $ this -> _current_update ; } } else { $ this -> _latest = $ this -> _current_update ; } } break ; case 'UPDATES' : if ( isset ( $ this -> _latest ) ) { foreach ( get_object_vars ( $ this -> _latest ) as $ key => $ val ) { $ this -> $ key = $ val ; } unset ( $ this -> _latest ) ; unset ( $ this -> _current_update ) ; } else if ( isset ( $ this -> _current_update ) ) { unset ( $ this -> _current_update ) ; } break ; } }
Callback for closing the element
 @param   object  $parser  Parser object
 @param   string  $name    Name of element that was closed
Callback for closing the element @param object $parser Parser object @param string $name Name of element that was closed
// Closing update, find the latest version and check // If the latest item is set then we transfer it to where we want to // The update might be for an older version of j!