mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-21 05:43:32 -07:00
Added blocking of names ending in .
This commit is contained in:
parent
5b954a8542
commit
365e1e6f56
1 changed files with 2 additions and 1 deletions
|
@ -302,9 +302,10 @@ bool TorrentContentModel::setData(const QModelIndex &index, const QVariant &valu
|
||||||
{
|
{
|
||||||
const QString currentName = item->name();
|
const QString currentName = item->name();
|
||||||
QString newName = value.toString().trimmed();
|
QString newName = value.toString().trimmed();
|
||||||
|
|
||||||
if (currentName != newName)
|
if (currentName != newName)
|
||||||
{
|
{
|
||||||
bool invalid = newName.isEmpty() || (newName == u"."_s) || (newName == u".."_s) || (newName.length() > 255);
|
bool invalid = newName.isEmpty() || (newName == u"."_s) || (newName == u".."_s) || (newName.length() > 255) || newName.endsWith(u'.');
|
||||||
if (!invalid)
|
if (!invalid)
|
||||||
{
|
{
|
||||||
for (const QChar &c : newName)
|
for (const QChar &c : newName)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue