Author: nickvergessen
Date: Fri Jul 24 08:56:06 2009
New Revision: 9842
Log:
Fix bug #31505 - Do not cut post-message in between HTML-Entities on search.php - Patch by leviatan21
Authorised by: AcydBurn
Modified:
branches/phpBB-3_0_0/phpBB/docs/CHANGELOG.html
branches/phpBB-3_0_0/phpBB/includes/functions_content.php
Modified: branches/phpBB-3_0_0/phpBB/docs/CHANGELOG.html
==============================================================================
*** branches/phpBB-3_0_0/phpBB/docs/CHANGELOG.html (original)
--- branches/phpBB-3_0_0/phpBB/docs/CHANGELOG.html Fri Jul 24 08:56:06 2009
***************
*** 173,178 ****
--- 173,179 ----
<li>[Fix] Fix set_custom_template for database-stored styles (Bug #40515 - Patch by nickvergessen)</li>
<li>[Fix] Banning an already banned user states to be successful, but has no effect (Bug #47825 - Patch by Pyramide)</li>
<li>[Fix] Do not add style-parameter to URL again, after admin re-authentification (Bug #18005 - Patch by leviatan21)</li>
+ <li>[Fix] Do not cut post-message in between HTML-Entities on search.php (Bug #31505 - Patch by leviatan21)</li>
<li>[Change] Change the data format of the default file ACM to be more secure from tampering and have better performance.</li>
<li>[Change] Add index on log_time to the log table to prevent slowdown on boards with many log entries. (Bug #44665 - Patch by bantu)</li>
<li>[Change] Template engine now permits to a limited extent variable includes.</li>
Modified: branches/phpBB-3_0_0/phpBB/includes/functions_content.php
==============================================================================
*** branches/phpBB-3_0_0/phpBB/includes/functions_content.php (original)
--- branches/phpBB-3_0_0/phpBB/includes/functions_content.php Fri Jul 24 08:56:06 2009
***************
*** 250,255 ****
--- 250,260 ----
// first replace all whitespaces with single spaces
$text = preg_replace('/ +/', ' ', strtr($text, "\t\n\r\x0C ", ' '));
+ // we need to turn the entities back into their original form, to not cut the message in between them
+ $entities = array('<', '>', '[', ']', '.', ':', ':');
+ $characters = array('<', '>', '[', ']', '.', ':', ':');
+ $text = str_replace($entities, $characters, $text);
+
$word_indizes = array();
if (sizeof($words))
{
***************
*** 345,357 ****
}
}
}
! return $final_text;
}
}
if (!sizeof($words) || !sizeof($word_indizes))
{
! return (utf8_strlen($text) >= $length + 3) ? utf8_substr($text, 0, $length) . '...' : $text;
}
}
--- 350,362 ----
}
}
}
! return str_replace($characters, $entities, $final_text);
}
}
if (!sizeof($words) || !sizeof($word_indizes))
{
! return str_replace($characters, $entities, ((utf8_strlen($text) >= $length + 3) ? utf8_substr($text, 0, $length) . '...' : $text));
}
}
|