[vlc-commits] [Git][videolan/vlc][master] qt: trim trailing space in `UrlValidator`
Steve Lhomme (@robUx4)
gitlab at videolan.org
Mon Jan 27 07:47:11 UTC 2025
Steve Lhomme pushed to branch master at VideoLAN / VLC
Commits:
aaa3af76 by Fatih Uzunoglu at 2025-01-27T07:27:33+00:00
qt: trim trailing space in `UrlValidator`
We should treat the trailing space invalid character
and trim it instead of percent encoding it.
- - - - -
1 changed file:
- modules/gui/qt/util/validators.cpp
Changes:
=====================================
modules/gui/qt/util/validators.cpp
=====================================
@@ -28,7 +28,7 @@
QValidator::State UrlValidator::validate( QString& str, int& ) const
{
- if( str.startsWith( ' ' ) )
+ if( str.startsWith( ' ' ) || str.endsWith( ' ' ) )
return QValidator::Invalid;
if ( str.isEmpty() )
@@ -43,8 +43,7 @@ QValidator::State UrlValidator::validate( QString& str, int& ) const
void UrlValidator::fixup( QString & input ) const
{
- while( input.startsWith( ' ' ) )
- input.chop( 1 );
+ input = input.trimmed();
QUrl fixed( input, QUrl::TolerantMode );
input = fixed.toString();
}
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/aaa3af7615ca71b9a85e38326aecf74dfc2ebff3
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/aaa3af7615ca71b9a85e38326aecf74dfc2ebff3
You're receiving this email because of your account on code.videolan.org.
VideoLAN code repository instance
More information about the vlc-commits
mailing list