Commit 5b940f25 authored by mmn's avatar mmn

Mediafile updated to insert urlhash and lookup properly

parent c05e9b11
......@@ -141,10 +141,11 @@ class MediaFile
function maybeAddRedir($file_id, $url)
{
$file_redir = File_redirection::getKV('url', $url);
if (!$file_redir instanceof File_redirection) {
try {
$file_redir = File_redirection::getByUrl($url);
} catch (NoResultException $e) {
$file_redir = new File_redirection;
$file_redir->urlhash = File::hashurl($url);
$file_redir->url = $url;
$file_redir->file_id = $file_id;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment