Fix for attachment "h bug": posting a shortened link to an oembed-able resource that has been previously used in the system would incorrectly save "h" as the item's type and title.

This commit is contained in:
Brion Vibber
2010-03-10 13:39:42 -08:00
parent 4741683298
commit f02cb7c718
3 changed files with 62 additions and 6 deletions

View File

@@ -67,7 +67,14 @@ class File extends Memcached_DataObject
return $att;
}
function saveNew($redir_data, $given_url) {
/**
* Save a new file record.
*
* @param array $redir_data lookup data eg from File_redirection::where()
* @param string $given_url
* @return File
*/
function saveNew(array $redir_data, $given_url) {
$x = new File;
$x->url = $given_url;
if (!empty($redir_data['protected'])) $x->protected = $redir_data['protected'];