Skip to content

Commit

Permalink
WMS 1.3.0 compliance: throw exception if bbox is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
mhugent authored and rldhont committed Dec 12, 2016
1 parent 476ac27 commit 763c9b7
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/server/qgswmsserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -690,6 +690,10 @@ static QgsRectangle _parseBBOX( const QString &bboxStr, bool &ok )
}

ok = true;
if ( d[2] <= d[0] || d[3] <= d[1] )
{
throw QgsMapServiceException( "InvalidParameterValue", "BBOX is empty" );
}
return QgsRectangle( d[0], d[1], d[2], d[3] );
}

Expand Down Expand Up @@ -2035,6 +2039,11 @@ int QgsWMSServer::configureMapRender( const QPaintDevice* paintDevice ) const
throw QgsMapServiceException( "InvalidParameterValue", "Invalid BBOX parameter" );
}

if ( mapExtent.isEmpty() )
{
throw QgsMapServiceException( "InvalidParameterValue", "BBOX is empty" );
}

QGis::UnitType mapUnits = QGis::Degrees;

QString crs = mParameters.value( "CRS", mParameters.value( "SRS" ) );
Expand Down

0 comments on commit 763c9b7

Please sign in to comment.