Skip to content

Commit d11f0f5

Browse files
etienneskyjef-n
authored andcommitted
trim proj4 parameters for sql queries (#5598)
1 parent b7f5c28 commit d11f0f5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/core/qgscoordinatereferencesystem.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -523,9 +523,10 @@ bool QgsCoordinateReferenceSystem::createFromProj4( const QString theProj4String
523523

524524
// split on spaces followed by a plus sign (+) to deal
525525
// also with parameters containing spaces (e.g. +nadgrids)
526+
// make sure result is trimmed (#5598)
526527
foreach( QString param, theProj4String.split( QRegExp( "\\s+(?=\\+)" ), QString::SkipEmptyParts ) )
527528
{
528-
QString arg = QString( "' '||parameters||' ' LIKE %1" ).arg( quotedValue( QString( "% %1 %" ).arg( param ) ) );
529+
QString arg = QString( "' '||parameters||' ' LIKE %1" ).arg( quotedValue( QString( "% %1 %" ).arg( param.trimmed() ) ) );
529530
if ( param.startsWith( "+datum=" ) )
530531
{
531532
datum = arg;

0 commit comments

Comments
 (0)