loadArray($array['params']); $array['params'] = $registry->toString(); } return parent::bind($array, $ignore); } /** * Overloaded check method to ensure data integrity * * @access public * @return boolean True on success * @since 1.0 */ function check() { if (JFilterInput::checkAttribute(array ('href', $this->url))) { $this->setError( JText::_('Please provide a valid URL')); return false; } //Remove all HTML tags from the title and description $filter = new JFilterInput(array(), array(), 0, 0); $this->description = $filter->clean($this->description); $this->title = $filter->clean($this->title); /** check for valid name */ if (trim($this->title) == '') { $this->setError(JText::_('Your Weblink must contain a title.')); return false; } if (!(eregi('http://', $this->url) || (eregi('https://', $this->url)) || (eregi('ftp://', $this->url)))) { $this->url = 'http://'.$this->url; } /** check for existing name */ $query = 'SELECT id FROM #__weblinks WHERE title = '.$this->_db->Quote($this->title).' AND catid = '.(int) $this->catid; $this->_db->setQuery($query); $xid = intval($this->_db->loadResult()); if ($xid && $xid != intval($this->id)) { $this->setError(JText::sprintf('WARNNAMETRYAGAIN', JText::_('Web Link'))); return false; } if(empty($this->alias)) { $this->alias = $this->title; } $this->alias = JFilterOutput::stringURLSafe($this->alias); if(trim(str_replace('-','',$this->alias)) == '') { $datenow =& JFactory::getDate(); $this->alias = $datenow->toFormat("%Y-%m-%d-%H-%M-%S"); } return true; } }