mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
- [Fix] Do not detect the board URL as a link twice in posts (Bug #19215)
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8462 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
45673658a1
commit
50e1d93887
2 changed files with 16 additions and 5 deletions
|
@ -144,7 +144,7 @@
|
||||||
<li>[Fix] Correctly obtain to be ignored users within topic/forum notification (Bug #21795 - patch provided by dr.death)</li>
|
<li>[Fix] Correctly obtain to be ignored users within topic/forum notification (Bug #21795 - patch provided by dr.death)</li>
|
||||||
<li>[Fix] Correctly update board statistics for attaching orphaned files to existing posts (Bug #20185)</li>
|
<li>[Fix] Correctly update board statistics for attaching orphaned files to existing posts (Bug #20185)</li>
|
||||||
<li>[Sec] Only allow searching by email address in memberlist for users having the a_user permission (reported by evil<3)</li>
|
<li>[Sec] Only allow searching by email address in memberlist for users having the a_user permission (reported by evil<3)</li>
|
||||||
|
<li>[Fix] Do not detect the board URL as a link twice in posts (Bug #19215)</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<a name="v30rc8"></a><h3>1.i. Changes since 3.0.RC8</h3>
|
<a name="v30rc8"></a><h3>1.i. Changes since 3.0.RC8</h3>
|
||||||
|
|
|
@ -492,6 +492,7 @@ function generate_text_for_edit($text, $uid, $flags)
|
||||||
*/
|
*/
|
||||||
function make_clickable_callback($type, $whitespace, $url, $relative_url, $class)
|
function make_clickable_callback($type, $whitespace, $url, $relative_url, $class)
|
||||||
{
|
{
|
||||||
|
$orig_url = $url . $relative_url;
|
||||||
$append = '';
|
$append = '';
|
||||||
$url = htmlspecialchars_decode($url);
|
$url = htmlspecialchars_decode($url);
|
||||||
$relative_url = htmlspecialchars_decode($relative_url);
|
$relative_url = htmlspecialchars_decode($relative_url);
|
||||||
|
@ -558,29 +559,39 @@ function make_clickable_callback($type, $whitespace, $url, $relative_url, $class
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$short_url = (strlen($url) > 55) ? substr($url, 0, 39) . ' ... ' . substr($url, -10) : $url;
|
||||||
|
|
||||||
switch ($type)
|
switch ($type)
|
||||||
{
|
{
|
||||||
case MAGIC_URL_LOCAL:
|
case MAGIC_URL_LOCAL:
|
||||||
$tag = 'l';
|
$tag = 'l';
|
||||||
$relative_url = preg_replace('/[&?]sid=[0-9a-f]{32}$/', '', preg_replace('/([&?])sid=[0-9a-f]{32}&/', '$1', $relative_url));
|
$relative_url = preg_replace('/[&?]sid=[0-9a-f]{32}$/', '', preg_replace('/([&?])sid=[0-9a-f]{32}&/', '$1', $relative_url));
|
||||||
$url = $url . '/' . $relative_url;
|
$url = $url . '/' . $relative_url;
|
||||||
$text = ($relative_url) ? $relative_url : $url;
|
$text = $relative_url;
|
||||||
|
|
||||||
|
// this url goes to http://domain.tld/path/to/board/ which
|
||||||
|
// would result in an empty link if treated as local so
|
||||||
|
// don't touch it and let MAGIC_URL_FULL take care of it.
|
||||||
|
if (!$relative_url)
|
||||||
|
{
|
||||||
|
return $orig_url . '/'; // slash is taken away by relative url pattern
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MAGIC_URL_FULL:
|
case MAGIC_URL_FULL:
|
||||||
$tag = 'm';
|
$tag = 'm';
|
||||||
$text = (strlen($url) > 55) ? substr($url, 0, 39) . ' ... ' . substr($url, -10) : $url;
|
$text = $short_url;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MAGIC_URL_WWW:
|
case MAGIC_URL_WWW:
|
||||||
$tag = 'w';
|
$tag = 'w';
|
||||||
$url = 'http://' . $url;
|
$url = 'http://' . $url;
|
||||||
$text = (strlen($url) > 55) ? substr($url, 0, 39) . ' ... ' . substr($url, -10) : $url;
|
$text = $short_url;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MAGIC_URL_EMAIL:
|
case MAGIC_URL_EMAIL:
|
||||||
$tag = 'e';
|
$tag = 'e';
|
||||||
$text = (strlen($url) > 55) ? substr($url, 0, 39) . ' ... ' . substr($url, -10) : $url;
|
$text = $short_url;
|
||||||
$url = 'mailto:' . $url;
|
$url = 'mailto:' . $url;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue