Skip to content

Commit

Permalink
fixed: Copying from URL-encoded sources to non-URL-encoded targets cr…
Browse files Browse the repository at this point in the history
…eated wrong destination file names
  • Loading branch information
arnova committed Jul 1, 2012
1 parent 35e9757 commit c7a55da
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions xbmc/utils/FileOperationJob.cpp
Expand Up @@ -134,6 +134,11 @@ bool CFileOperationJob::DoProcess(FileAction action, CFileItemList & items, cons
URIUtils::RemoveSlashAtEnd(strNoSlash);
CStdString strFileName = URIUtils::GetFileName(strNoSlash);

// URL Decode for cases where source uses URL encoding and target does not
if ( URIUtils::ProtocolHasEncodedFilename(CURL(pItem->GetPath()).GetProtocol() )
&& !URIUtils::ProtocolHasEncodedFilename(CURL(strDestFile).GetProtocol() ) )
CURL::Decode(strFileName);

// special case for upnp
if (URIUtils::IsUPnP(items.GetPath()) || URIUtils::IsUPnP(pItem->GetPath()))
{
Expand Down

0 comments on commit c7a55da

Please sign in to comment.