Landing url parsing branch. 73845. r=alecf@netscape.com, sr=darin@netscape.com, a=blizzard@rednat.com.
This fixes many crashes caused by illegal uses of the nsStdURL. This also allows a plugable protocol to provide their own url parser. git-svn-id: svn://10.0.0.236/trunk@97696 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -611,18 +611,15 @@ NS_IMETHODIMP nsHTMLEditor::InsertFromTransferable(nsITransferable *transferable
|
||||
nsCOMPtr<nsIFile> fileObj ( do_QueryInterface(genericDataObj) );
|
||||
if (fileObj && len > 0)
|
||||
{
|
||||
nsCOMPtr<nsIFileURL> fileURL;
|
||||
rv = nsComponentManager::CreateInstance("@mozilla.org/network/standard-url;1", nsnull,
|
||||
NS_GET_IID(nsIURL), getter_AddRefs(fileURL));
|
||||
|
||||
nsCOMPtr<nsIURI> uri;
|
||||
rv = NS_NewFileURI(getter_AddRefs(uri), fileObj);
|
||||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
|
||||
nsCOMPtr<nsIURL> fileURL(do_QueryInterface(uri));
|
||||
if ( fileURL )
|
||||
{
|
||||
rv = fileURL->SetFile( fileObj );
|
||||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
|
||||
PRBool insertAsImage = PR_FALSE;
|
||||
char *fileextension = nsnull;
|
||||
rv = fileURL->GetFileExtension( &fileextension );
|
||||
|
||||
Reference in New Issue
Block a user