server getfeatureinfo: restore quoting in plain/text format

This commit is contained in:
Juergen E. Fischer 2015-02-16 11:06:11 +01:00
parent e338daf206
commit b3bd32ff96
2 changed files with 2 additions and 12 deletions

View File

@ -368,8 +368,8 @@ void QgsHttpRequestHandler::setGetFeatureInfoResponse( const QDomDocument& infoD
QDomElement attributeElement = attributeNodeList.at( k ).toElement(); QDomElement attributeElement = attributeNodeList.at( k ).toElement();
if ( infoFormat == "text/plain" ) if ( infoFormat == "text/plain" )
{ {
featureInfoString.append( attributeElement.attribute( "name" ) + " = " + featureInfoString.append( attributeElement.attribute( "name" ) + " = '" +
attributeElement.attribute( "value" ) + "\n" ); attributeElement.attribute( "value" ) + "'\n" );
} }
else if ( infoFormat == "text/html" ) else if ( infoFormat == "text/html" )
{ {

View File

@ -2101,16 +2101,6 @@ int QgsWMSServer::featureInfoFromVectorLayer( QgsVectorLayer* layer,
else else
{ {
value = replaceValueMapAndRelation( layer, i, QgsExpression::replaceExpressionText( featureAttributes[i].toString(), &feature, layer ) ); value = replaceValueMapAndRelation( layer, i, QgsExpression::replaceExpressionText( featureAttributes[i].toString(), &feature, layer ) );
switch ( featureAttributes[i].type() )
{
case QVariant::Int:
case QVariant::LongLong:
case QVariant::Double:
break;
default:
value = "'" + value + "'";
}
} }
attributeElement.setAttribute( "value", value ); attributeElement.setAttribute( "value", value );