mosDBTable( '#__weblinks', 'id', $db ); } /** overloaded check function */ function check() { // filter malicious code $ignoreList = array( 'params' ); $this->filter( $ignoreList ); // specific filters $callcheck = array('InputFilter', 'process'); if (!is_callable($callcheck)) require_once(mamboCore::get('mosConfig_absolute_path').'/includes/phpInputFilter/class.inputfilter.php'); // specific filters $iFilter =& new InputFilter(); if ($iFilter->badAttributeValue( array( 'href', $this->url ))) { $this->_error = T_('Please provide a valid URL'); return false; } /** check for valid name */ if (trim( $this->title ) == '') { $this->_error = T_('Your web link must be given 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 */ $this->title = $this->_db->getEscaped($this->title); $this->catid = $this->_db->getEscaped($this->catid); $this->_db->setQuery( "SELECT id FROM #__weblinks " . "\nWHERE title='$this->title' AND catid='$this->catid'" ); $xid = intval( $this->_db->loadResult() ); if ($xid && $xid != intval( $this->id )) { $this->_error = T_('There is already a web link that name, please try again.'); return false; } return true; } } ?>