phpBB

Code Changes

File: phpbb/textformatter/s9e/factory.php

  Unmodified   Added   Modified   Removed
Line 78Line 78
		'b'     => '[B]{TEXT}[/B]',
'code' => '[CODE lang={IDENTIFIER;optional}]{TEXT}[/CODE]',
'color' => '[COLOR={COLOR}]{TEXT}[/COLOR]',

		'b'     => '[B]{TEXT}[/B]',
'code' => '[CODE lang={IDENTIFIER;optional}]{TEXT}[/CODE]',
'color' => '[COLOR={COLOR}]{TEXT}[/COLOR]',

		'email' => '[EMAIL={EMAIL;useContent} subject={TEXT;optional;postFilter=rawurlencode} body={TEXT;optional;postFilter=rawurlencode}]{TEXT}[/EMAIL]',

		'email' => '[EMAIL={EMAIL;useContent} subject={TEXT1;optional;postFilter=rawurlencode} body={TEXT2;optional;postFilter=rawurlencode}]{TEXT}[/EMAIL]',

		'flash' => '[FLASH={NUMBER1},{NUMBER2} width={NUMBER1;postFilter=#flashwidth} height={NUMBER2;postFilter=#flashheight} url={URL;useContent} /]',
'i' => '[I]{TEXT}[/I]',
'img' => '[IMG src={IMAGEURL;useContent}]',

		'flash' => '[FLASH={NUMBER1},{NUMBER2} width={NUMBER1;postFilter=#flashwidth} height={NUMBER2;postFilter=#flashheight} url={URL;useContent} /]',
'i' => '[I]{TEXT}[/I]',
'img' => '[IMG src={IMAGEURL;useContent}]',

Line 266Line 266
			->addParameterByName('logger')
->addParameterByName('max_img_height')
->addParameterByName('max_img_width')

			->addParameterByName('logger')
->addParameterByName('max_img_height')
->addParameterByName('max_img_width')

			->markAsSafeAsURL();


			->markAsSafeAsURL()
->setJS('UrlFilter.filter');


// Add default BBCodes
foreach ($this->get_default_bbcodes($configurator) as $bbcode)
{


// Add default BBCodes
foreach ($this->get_default_bbcodes($configurator) as $bbcode)
{

			$configurator->BBCodes->addCustom($bbcode['usage'], $bbcode['template']);






			$configurator->BBCodes->addCustom($bbcode['usage'], new UnsafeTemplate($bbcode['template']));
}
if (isset($configurator->tags['QUOTE']))
{
// Remove the nesting limit and let other services remove quotes at parsing time
$configurator->tags['QUOTE']->nestingLimit = PHP_INT_MAX;

		}

// Modify the template to disable images/flash depending on user's settings

		}

// Modify the template to disable images/flash depending on user's settings

Line 323Line 329
			// Only parse emoticons at the beginning of the text or if they're preceded by any
// one of: a new line, a space, a dot, or a right square bracket
$configurator->Emoticons->notAfter = '[^\\n .\\]]';

			// Only parse emoticons at the beginning of the text or if they're preceded by any
// one of: a new line, a space, a dot, or a right square bracket
$configurator->Emoticons->notAfter = '[^\\n .\\]]';

 

// Ignore emoticons that are immediately followed by a "word" character
$configurator->Emoticons->notBefore = '\\w';

		}

// Load the censored words

		}

// Load the censored words

Line 347Line 356
		$configurator->registeredVars['max_img_width'] = 0;

// Load the Emoji plugin and modify its tag's template to obey viewsmilies

		$configurator->registeredVars['max_img_width'] = 0;

// Load the Emoji plugin and modify its tag's template to obey viewsmilies

		$configurator->Emoji->omitImageSize();
$configurator->Emoji->useSVG();

 
		$tag = $configurator->Emoji->getTag();
$tag->template = '<xsl:choose><xsl:when test="$S_VIEWSMILIES">' . str_replace('class="emoji"', 'class="emoji smilies"', $tag->template) . '</xsl:when><xsl:otherwise><xsl:value-of select="."/></xsl:otherwise></xsl:choose>';


		$tag = $configurator->Emoji->getTag();
$tag->template = '<xsl:choose><xsl:when test="$S_VIEWSMILIES">' . str_replace('class="emoji"', 'class="emoji smilies"', $tag->template) . '</xsl:when><xsl:otherwise><xsl:value-of select="."/></xsl:otherwise></xsl:choose>';


Line 382Line 389
			unset($configurator->tags['censor:tag']);
}


			unset($configurator->tags['censor:tag']);
}


		$objects  = $configurator->finalize();












		$objects = $configurator->finalize();

/**
* Access the objects returned by finalize() before they are saved to cache
*
* @event core.text_formatter_s9e_configure_finalize
* @var array objects Array containing a "parser" object, a "renderer" object and optionally a "js" string
* @since 3.2.2-RC1
*/
$vars = array('objects');
extract($this->dispatcher->trigger_event('core.text_formatter_s9e_configure_finalize', compact($vars)));


		$parser   = $objects['parser'];
$renderer = $objects['renderer'];


		$parser   = $objects['parser'];
$renderer = $objects['renderer'];


Line 518Line 536
	protected function extract_templates($template)
{
// Capture the template fragments

	protected function extract_templates($template)
{
// Capture the template fragments

		preg_match_all('#<!-- BEGIN (.*?) -->(.*?)<!-- END .*? -->#s', $template, $matches, PREG_SET_ORDER);



		// Allow either phpBB template or the Twig syntax
preg_match_all('#<!-- BEGIN (.*?) -->(.*?)<!-- END .*? -->#s', $template, $matches, PREG_SET_ORDER) ?:
preg_match_all('#{% for (.*?) in .*? %}(.*?){% endfor %}#s', $template, $matches, PREG_SET_ORDER);


$fragments = array();
foreach ($matches as $match)


$fragments = array();
foreach ($matches as $match)