Closed (fixed)
Project:
Media Manager
Version:
5.x-0.x-dev
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
10 Apr 2008 at 16:03 UTC
Updated:
20 Nov 2008 at 09:53 UTC
One thing that should be noted is that a crucial fatal flaw in adding media via the upload section.
It turns out that the section of code that tries to find a HASH value is incorrect.
// find a unique hash for the media.
do {
$hash = md5($media->path . chr(rand()));
$result = db_query("SELECT hash FROM {media} WHERE hash='%s'", $hash);
$obj = db_fetch_object($result);
} while ($obj);
should be:
// find a unique hash for the media.
$count = 1;
$test = serialize($media);
do {
$hash = md5($test . $count++);
$result = db_result(db_query("SELECT hash FROM {media} WHERE hash='%s'", $hash));
} while ($result);
This should solve potential problems with not being able to upload media correctly, once a large enough set of media exist.
This is being updated in the versions I'll be uploading fairly soon.
Comments
Comment #1
rhys commentedFixes already exist in the d6, head cvs versions, d5 will be backported from d6 soon.