Skip to content

Commit

Permalink
fixed: convert html entities in HTTPDirectory - fixes wrongly formatt…
Browse files Browse the repository at this point in the history
…ed titles and/or missing items
  • Loading branch information
mkortstiege committed Dec 2, 2011
1 parent 2494ce8 commit d660bcd
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions xbmc/filesystem/HTTPDirectory.cpp
Expand Up @@ -29,6 +29,7 @@
#include "utils/CharsetConverter.h"
#include "utils/log.h"
#include "utils/URIUtils.h"
#include "utils/HTMLUtil.h"
#include "climits"

using namespace XFILE;
Expand Down Expand Up @@ -76,19 +77,27 @@ bool CHTTPDirectory::GetDirectory(const CStdString& strPath, CFileItemList &item

if (strNameTemp == strLinkTemp)
{
CStdStringW wName, wLink, wConverted;

g_charsetConverter.unknownToUTF8(strName);
g_charsetConverter.utf8ToW(strName, wName, false);
HTML::CHTMLUtil::ConvertHTMLToW(wName, wConverted);
g_charsetConverter.wToUTF8(wConverted, strName);
URIUtils::RemoveSlashAtEnd(strName);

g_charsetConverter.unknownToUTF8(strLink);
g_charsetConverter.utf8ToW(strLink, wLink, false);
HTML::CHTMLUtil::ConvertHTMLToW(wLink, wConverted);
g_charsetConverter.wToUTF8(wConverted, strLink);

CFileItemPtr pItem(new CFileItem(strName));
pItem->SetPath(strBasePath + strLink);
pItem->SetProperty("IsHTTPDirectory", true);
url.SetFileName(strBasePath + strLink);
pItem->SetPath(url.Get());

if(URIUtils::HasSlashAtEnd(pItem->GetPath()))
pItem->m_bIsFolder = true;

url.SetFileName(pItem->GetPath());
pItem->SetPath(url.Get());

if (!pItem->m_bIsFolder && g_advancedSettings.m_bHTTPDirectoryStatFilesize)
{
CFileCurl file;
Expand Down

0 comments on commit d660bcd

Please sign in to comment.