|
@@ -162,6 +162,24 @@ bool WelcomeScreenDialog::eventFilter(QObject *watched, QEvent *event)
|
|
|
return QDialog::eventFilter(watched, event);
|
|
|
}
|
|
|
|
|
|
+bool WelcomeScreenDialog::IsValidLevelName(const QString& path)
|
|
|
+{
|
|
|
+ QStringList pathParts = Path::SplitIntoSegments(path);
|
|
|
+
|
|
|
+ QString levelName = pathParts.at(pathParts.size() - 1);
|
|
|
+ if (!levelName.endsWith(".prefab", Qt::CaseInsensitive))
|
|
|
+ {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ QString containerName = pathParts.at(pathParts.size() - 2);
|
|
|
+
|
|
|
+ QRegExpValidator validator(QRegExp("^[a-zA-Z0-9_\\-./]*$"));
|
|
|
+
|
|
|
+ int pos = 0;
|
|
|
+ return validator.validate(containerName, pos);
|
|
|
+}
|
|
|
+
|
|
|
void WelcomeScreenDialog::SetRecentFileList(RecentFileList* pList)
|
|
|
{
|
|
|
if (!pList)
|
|
@@ -186,7 +204,7 @@ void WelcomeScreenDialog::SetRecentFileList(RecentFileList* pList)
|
|
|
for (int i = 0; i < recentListSize; ++i)
|
|
|
{
|
|
|
const QString& recentFile = pList->m_arrNames[i];
|
|
|
- if (recentFile.endsWith(m_levelExtension))
|
|
|
+ if (recentFile.endsWith(m_levelExtension) && IsValidLevelName(recentFile))
|
|
|
{
|
|
|
if (CFileUtil::Exists(recentFile, false))
|
|
|
{
|