Skip to content

Commit 6309dbd

Browse files
committed
server: accept empty bbox as valid (followup 57046c5, fixes #12440)
1 parent 7469d2b commit 6309dbd

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/server/qgswmsserver.cpp

+3-7
Original file line numberDiff line numberDiff line change
@@ -613,12 +613,8 @@ static QgsRectangle _parseBBOX( const QString &bboxStr, bool &ok )
613613
return QgsRectangle();
614614
}
615615

616-
QgsRectangle bbox( d[0], d[1], d[2], d[3] );
617-
if ( bbox.isEmpty() )
618-
return QgsRectangle();
619-
620616
ok = true;
621-
return bbox;
617+
return QgsRectangle( d[0], d[1], d[2], d[3] );
622618
}
623619

624620

@@ -646,7 +642,7 @@ QImage* QgsWMSServer::getLegendGraphics()
646642

647643
bool bboxOk;
648644
contentBasedLegendExtent = _parseBBOX( mParameters["BBOX"], bboxOk );
649-
if ( !bboxOk )
645+
if ( !bboxOk || contentBasedLegendExtent.isEmpty() )
650646
throw QgsMapServiceException( "InvalidParameterValue", "Invalid BBOX parameter" );
651647

652648
if ( mParameters.contains( "RULE" ) )
@@ -1772,7 +1768,7 @@ int QgsWMSServer::configureMapRender( const QPaintDevice* paintDevice ) const
17721768
mMapRenderer->setOutputSize( QSize( paintDevice->width(), paintDevice->height() ), paintDevice->logicalDpiX() );
17731769

17741770
//map extent
1775-
bool bboxOk = true;
1771+
bool bboxOk;
17761772
QgsRectangle mapExtent = _parseBBOX( mParameters.value( "BBOX", "0,0,0,0" ), bboxOk );
17771773
if ( !bboxOk )
17781774
{

0 commit comments

Comments
 (0)