qgis/Quantum-GIS — pull request #469 by olivierdalang (2013-03-16 21:17:42+00:00)
Title: Sanitize entry names to avoid make project unreadable

Hi !

When using QgsProject.instance().writeEntry(scope, key, value), it's really easy to make the whole project file unreadable.

This happens because scope and keys are used as XML elements names in the project file.

In case a plugin developer uses user input as the key, he may not notice that he's endangering the user's files.

The commit sanitize scope and keys to make sure the project's XML remains valid whatever scope/key is used. The regexp are done using this : http://www.w3.org/TR/REC-xml/#NT-NameStartChar

http://hub.qgis.org/issues/7371 can be closed upon merge...

Thanks !

Olivier