Version 3.4.8

This commit is contained in:
Neo committed 2025-12-19 00:42:42 -08:00
1 parent b45ea0dffb
commit c603205a25
1398 files changed
+36675 -31023

No files matched your search

@@ -391,6 +391,10 @@ class HTMLPurifier_Encoder
$str = utf8_decode($str);
return $str;
}
else
{
return IPSText::convertCharsets( $str, $encoding );
}
trigger_error('Encoding not supported', E_USER_ERROR);
// You might be tempted to assume that the ASCII representation
// might be OK, however, this is *not* universally true over all
@@ -68,18 +68,57 @@ http://en.wikipedia.org/wiki/Assassin's_Creed
{
if( $matches[1][$k] )
{
if ( stripos( $matches[1][$k], '[' ) !== FALSE AND stripos( $matches[4][$k], ']' ) !== FALSE )
{
/* Concatenate and test to make sure we're not linking inside a bbcode option */
$test = $matches[1][$k] . $matches[3][$k] . $matches[4][$k];
if ( preg_match( '#\[([a-zA-Z]+)\=(http:\/\/|https:\/\/|ftp"\/\/)#i', $test ) )
{
$matches[1][$k] .= $matches[3][$k] . $matches[4][$k];
unset( $matches[3][$k] );
unset( $matches[4][$k] );
}
}
$token[] = new HTMLPurifier_Token_Text($matches[1][$k]);
}
if( $matches[2][$k] )
{
$token[] = new HTMLPurifier_Token_Text($matches[2][$k]);
}
if( !$matches[2][$k] AND !in_array( $matches[4][$k], array( '!', '.', ',' ) ) AND strpos( $matches[4][$k], ' ' ) === false AND ! preg_match( "#(\r|\n|\r\n)#i", $matches[4][$k] ) )
/**
* This looks a little weird so bare with me. When attempting to detect the URL, a space is added to try and separate it from any non-URL text (ending BBCode tag, for example)
* Previously, the if() statement below checked to see if ANY spaces were added at all, and if so, we just stopped processing immediately. The posed problems where a URL such as:
* [mybbcode]https://test.domain.com/linkwith#!strangechars[/mybbcode] would be cut off at the exclamation point.
*
* As such, rather than trying to detect if there is a space anywhere in the string, we only check at the end of it. Inside the conditional, we look for the presence of a space,
* and if found, explode the string into to two pieces, starting from the first space found. If the first bit is not an exclamation point, full stop, or comma, then we add it to
* the URL, and reassign the other bit to $matches[4][$k]. Otherwise, we just recompile the bits together again into $matches[4][$k] and ignore them.
*
* mind = blown
*/
if( !$matches[2][$k] AND !in_array( $matches[4][$k], array( '!', '.', ',' ) ) AND substr( $matches[4][$k], 0, -1 ) !== ' ' AND ! preg_match( "#(\r|\n|\r\n)#i", $matches[4][$k] ) )
{
$matches[3][$k] .= $matches[4][$k];
unset($matches[4][$k]);
if ( stripos( $matches[4][$k], ' ' ) !== FALSE )
{
$bits = explode( ' ', $matches[4][$k], 2 );
if ( ! in_array( $bits[0], array( '!', '.', ',' ) ) )
{
$matches[3][$k] .= $bits[0];
$matches[4][$k] = $bits[1];
}
else
{
$matches[4][$k] = implode( ' ', $bits );
}
}
else
{
$matches[3][$k] .= $matches[4][$k];
unset($matches[4][$k]);
}
}
$token[] = new HTMLPurifier_Token_Start('a', array('href' => str_replace( '\'', '%27', $matches[3][$k] )));
@@ -112,6 +151,7 @@ http://en.wikipedia.org/wiki/Assassin's_Creed
{
$token[] = new HTMLPurifier_Token_Text( $matches[5][$k] );
}
}
}
}
+1 -1
View File
@@ -5,6 +5,6 @@
<hr>
You have reached this page in error, please use your back button to return to the forum.
<hr>
IP.Board
<a href="http://www.invisionpower.com/">IP.Board</a>
</body>
</html>