Parcourir la source

! remove fix long words, better handled with CSS

Signed-off-by: Spuds <[email protected]>
Spuds il y a 12 ans
Parent
commit
08d0188c79
1 fichiers modifiés avec 0 ajouts et 32 suppressions
  1. 0 32
      Sources/Subs.php

+ 0 - 32
Sources/Subs.php

@@ -826,7 +826,6 @@ function permute($array)
  * - caches the from/to replace regular expressions so as not to reload them every time a string is parsed.
  * - only parses smileys if smileys is true.
  * - does nothing if the enableBBC setting is off.
- * - applies the fixLongWords magic if the setting is set to on.
  * - uses the cache_id as a unique identifier to facilitate any caching it may do.
  *  -returns the modified message.
  *
@@ -1657,22 +1656,6 @@ function parse_bbc($message, $smileys = true, $cache_id = '', $parse_tags = arra
 	// The non-breaking-space looks a bit different each time.
 	$non_breaking_space = $context['utf8'] ? '\x{A0}' : '\xA0';
 
-	// This saves time by doing our break long words checks here.
-	if (!empty($modSettings['fixLongWords']) && $modSettings['fixLongWords'] > 5)
-	{
-		if (isBrowser('gecko') || isBrowser('konqueror'))
-			$breaker = '<span style="margin: 0 -0.5ex 0 0;"> </span>';
-		// Opera...
-		elseif (isBrowser('opera'))
-			$breaker = '<span style="margin: 0 -0.65ex 0 -1px;"> </span>';
-		// Internet Explorer...
-		else
-			$breaker = '<span style="width: 0; margin: 0 -0.6ex 0 -1px;"> </span>';
-
-		// PCRE will not be happy if we don't give it a short.
-		$modSettings['fixLongWords'] = (int) min(65535, $modSettings['fixLongWords']);
-	}
-
 	$pos = -1;
 	while ($pos !== false)
 	{
@@ -1807,21 +1790,6 @@ function parse_bbc($message, $smileys = true, $cache_id = '', $parse_tags = arra
 
 			$data = strtr($data, array("\t" => '&nbsp;&nbsp;&nbsp;'));
 
-			if (!empty($modSettings['fixLongWords']) && $modSettings['fixLongWords'] > 5)
-			{
-				// The idea is, find words xx long, and then replace them with xx + space + more.
-				if ($smcFunc['strlen']($data) > $modSettings['fixLongWords'])
-				{
-					// This is done in a roundabout way because $breaker has "long words" :P.
-					$data = strtr($data, array($breaker => '< >', '&nbsp;' => $context['utf8'] ? "\xC2\xA0" : "\xA0"));
-					$data = preg_replace(
-						'~(?<=[>;:!? ' . $non_breaking_space . '\]()\n]|^)([\w' . ($context['utf8'] ? '\pL' : '') . '\.]{' . $modSettings['fixLongWords'] . ',})~e' . ($context['utf8'] ? 'u' : ''),
-						'preg_replace(\'/(.{' . ($modSettings['fixLongWords'] - 1) . '})/' . ($context['utf8'] ? 'u' : '') . '\', \'\\$1< >\', \'$1\')',
-						$data);
-					$data = strtr($data, array('< >' => $breaker, $context['utf8'] ? "\xC2\xA0" : "\xA0" => '&nbsp;'));
-				}
-			}
-
 			// If it wasn't changed, no copying or other boring stuff has to happen!
 			if ($data != substr($message, $last_pos, $pos - $last_pos))
 			{