if ($input['thumb'])
{
/* @var $attachmentModel XenForo_Model_Attachment */
$attachmentModel = XenForo_Model::create('XenForo_Model_Attachment');
if ($attachment = $attachmentModel->getAttachmentById($input['attachmentid']))
{
$target = XenForo_Link::convertUriToAbsoluteUri($attachmentModel->getAttachmentThumbnailUrl($attachment));
}
}
else
{
$target = XenForo_Link::buildPublicLink('canonical:attachments', array('attachment_id' => $newId));
}
if ($attachment = $attachmentModel->getAttachmentById($newId))
Yes, this is expected. Notably, this is to prevent a potential information leak (title of non-visible threads).I had a question - it appears that these scripts are first redirecting to a XF url with the ID only and then XF is redirecting again to go to the friendly forum URL with the slug in it. Is this the way it should be working or should these scripts be figuring out the friendly URL w/ slug and including that in the first redirect
This version fixes an issue where attachment thumbnail redirects only worked if IDs were retained.
Thanks to @Ralle for the report.
You should probably look at direct rewrites via .htaccess then, bypassing redirection scripts entirely.I preserved my content IDs. Any version of these scripts that skips the table lookup?
Yes. It's a definite edge case though, as it's specific to attachment thumbnail embeds (which I suspect are quite rarely needed based on no one noticing this for so longI can just change that one line in attachment.php as suggested by Ralle to "install" the update, correct?
I don't know if that's my case... so I wonder if I can update all the files either way... hoping it will NOT do any harm.This version fixes an issue where attachment thumbnail redirects only worked if IDs were retained.
RewriteEngine on
RewriteRule [^ /] + / ([\ d] +) -. + -.? ([\ D] +) html showthread.php t = $ 1 & page = $ 2 [NC, L]
RewriteRule [^ /] + / ([\ d] +) - ..? + Html showthread.php t = $ 1 [NC, L]
There's are some tools to convert mod_rewrite rules to IIS web.config rules:I did all the tests with .htacess, I think since I have a windows server with IIS, the rewrite should be included in the web.config, I do not know how to do
If your IDs aren't the same, you have no choice but to rewrite them to this script. But if you have the confidence to rewrite them directly, then that would suffice as well. It's essentially the same thing (particularly if it's just an internal call to these scripts, rather than an extra 301).Would you guys rewrite the vBSEO Urls to point to this script and then do a redirect or would you redirect them directly?
Thank you Mike. I've already placed the redirects but redirection is not working the way I expect or maybe I am doing the wrong way.But if you've simply rewritten them to a different URL, you should place the redirects to cover that URL. You don't need your old database.
We use essential cookies to make this site work, and optional cookies to enhance your experience.