Commit b1c62793 authored by Angelo Haller's avatar Angelo Haller Committed by Jean-Baptiste Kempf

Sanitize file path before deletion.

Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent 71c1e355
......@@ -39,6 +39,7 @@
#include <QApplication>
#include <QFile>
#include <QDir>
#include <assert.h>
......@@ -726,6 +727,7 @@ void InputManager::setArt( input_item_t *p_item, QString fileUrl )
{
char *psz_cachedir = config_GetUserDir( VLC_CACHE_DIR );
QString old_url = THEMIM->getIM()->decodeArtURL( p_item );
old_url = QDir( old_url ).canonicalPath();
if( old_url.startsWith( QString::fromUtf8( psz_cachedir ) ) )
QFile( old_url ).remove(); /* Purge cached artwork */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment