/**
  * Verifies the page text is valid and sets it up for saving.
  *
  * @param	string	Page text
  *
  * @param	bool	Whether the text is valid
  */
 function verify_pagetext(&$pagetext)
 {
     if (empty($this->info['is_automated'])) {
         if ($this->registry->options['postmaxchars'] != 0 and ($postlength = vbstrlen($pagetext)) > $this->registry->options['postmaxchars']) {
             $this->error('toolong', $postlength, $this->registry->options['postmaxchars']);
             return false;
         }
         $this->registry->options['postminchars'] = intval($this->registry->options['postminchars']);
         if ($this->registry->options['postminchars'] <= 0) {
             $this->registry->options['postminchars'] = 1;
         }
         if (vbstrlen(strip_bbcode($pagetext, $this->registry->options['ignorequotechars'])) < $this->registry->options['postminchars']) {
             $this->error('tooshort', $this->registry->options['postminchars']);
             return false;
         }
     }
     return parent::verify_pagetext($pagetext);
 }
Example #2
0
	/**
	* Verifies the page text is valid and sets it up for saving.
	*
	* @param	string	Page text
	*
	* @param	bool	Whether the text is valid
	*/
	function verify_pagetext(&$pagetext)
	{
		if (empty($this->info['skip_charcount']))
		{
			$maxchars = $this->table == 'blog' ? $this->registry->options['vbblog_entrymaxchars'] : $this->registry->options['vbblog_commentmaxchars'];
			if ($maxchars != 0 AND ($postlength = vbstrlen($pagetext)) > $maxchars)
			{
				$this->error('toolong', $postlength, $maxchars);
				return false;
			}

			$this->registry->options['postminchars'] = intval($this->registry->options['postminchars']);
			if ($this->registry->options['postminchars'] <= 0)
			{
				$this->registry->options['postminchars'] = 1;
			}
			if (vbstrlen(strip_bbcode($pagetext)) < $this->registry->options['postminchars'])
			{
				$this->error('tooshort', $this->registry->options['postminchars']);
				return false;
			}
		}

		return parent::verify_pagetext($pagetext, false);
	}
	/**
	* Verifies the page text is valid and sets it up for saving.
	*
	* @param	string	Page text
	*
	* @param	bool	Whether the text is valid
	*/
	function verify_pagetext(&$pagetext)
	{
		if (empty($this->info['skip_charcount']))
		{
			if (!$this->fetch_field('type'))
			{
				trigger_error('vB_Datamanager_Blog_Custom_Block(): \'type\' must be set.', E_USER_ERROR);
			}
			if ($this->fetch_field('type'))
			{
				$maxchars = $this->registry->options['vbblog_blockmaxchars'];
			}
			else
			{
				$maxchars = $this->registry->options['vbblog_pagemaxchars'];
			}
			if ($maxchars != 0 AND ($postlength = vbstrlen($pagetext)) > $maxchars)
			{
				$this->error('toolong', $postlength, $maxchars);
				return false;
			}

			$this->registry->options['postminchars'] = intval($this->registry->options['postminchars']);
			if ($this->registry->options['postminchars'] <= 0)
			{
				$this->registry->options['postminchars'] = 1;
			}
			if (vbstrlen(strip_bbcode($pagetext, $this->registry->options['ignorequotechars'])) < $this->registry->options['postminchars'])
			{
				$this->error('tooshort', $this->registry->options['postminchars']);
				return false;
			}
		}

		return parent::verify_pagetext($pagetext, false);

	}
Example #4
0
 /**
  * Verifies the page text is valid and sets it up for saving.
  *
  * @param	string	Page text
  *
  * @param	bool	Whether the text is valid
  */
 function verify_pagetext(&$pagetext)
 {
     if (vbstrlen(strip_bbcode($pagetext, $this->registry->options['ignorequotechars'])) < 1) {
         $this->error('tooshort', 1);
         return false;
     }
     return parent::verify_pagetext($pagetext);
 }
Example #5
0
	/**
	* Verifies the page text is valid and sets it up for saving.
	*
	* @param	string	Page text
	*
	* @param	bool	Whether the text is valid
	*/
	function verify_pagetext(&$pagetext)
	{
		if (empty($this->info['skip_charcount']))
		{
			if ($this->registry->options['vbblog_usermaxchars'] != 0 AND ($postlength = vbstrlen($pagetext)) > $this->registry->options['vbblog_usermaxchars'])
			{
				$this->error('toolong', $postlength, $this->registry->options['vbblog_usermaxchars']);
				return false;
			}
		}

		return parent::verify_pagetext($pagetext);

	}