phpBB

Code Changes

File: phpbb/textreparser/base.php

  Unmodified   Added   Modified   Removed
Line 198Line 198
	*/
protected function guess_magic_url(array $record)
{

	*/
protected function guess_magic_url(array $record)
{

		// Look for <!-- m --> or for a URL tag that's not immediately followed by <s>
return (strpos($record['text'], '<!-- m -->') !== false || preg_match('(<URL [^>]++>(?!<s>))', $record['text']));

		// Look for magic URL markers or for a URL tag that's not immediately followed by <s>
return preg_match('#<!-- ([lmwe]) -->.*?<!-- \1 -->#', $record['text']) || preg_match('(<URL [^>]++>(?!<s>))', $record['text']);

	}

/**

	}

/**

Line 231Line 231
	*/
protected function reparse_record(array $record)
{

	*/
protected function reparse_record(array $record)
{

 
		// Guess magic URL state based on actual record content before adding fields
$record['enable_magic_url'] = $this->guess_magic_url($record);

		$record = $this->add_missing_fields($record);

		$record = $this->add_missing_fields($record);

 


		$flags = ($record['enable_bbcode']) ? OPTION_FLAG_BBCODE : 0;
$flags |= ($record['enable_smilies']) ? OPTION_FLAG_SMILIES : 0;
$flags |= ($record['enable_magic_url']) ? OPTION_FLAG_LINKS : 0;

		$flags = ($record['enable_bbcode']) ? OPTION_FLAG_BBCODE : 0;
$flags |= ($record['enable_smilies']) ? OPTION_FLAG_SMILIES : 0;
$flags |= ($record['enable_magic_url']) ? OPTION_FLAG_LINKS : 0;