[mapguide-trac] #1057: One error happened when setting Space as Log Delimiter.

MapGuide Open Source trac_mapguide at osgeo.org
Thu Jul 30 22:52:35 EDT 2009


#1057: One error happened when setting Space as Log Delimiter.
--------------------------+-------------------------------------------------
 Reporter:  christinebao  |         Owner:  Steve Dang
     Type:  defect        |        Status:  new       
 Priority:  medium        |     Milestone:  2.2       
Component:  General       |       Version:  2.0.2     
 Severity:  major         |    Resolution:            
 Keywords:                |   External_id:  1242050   
--------------------------+-------------------------------------------------
Comment (by christinebao):

 Thank you Trevor.[[BR]]

 I checked all calls to CheckReservedCharacters(), there are:

 1. ResourceIdentifier.cpp[[BR]]
 void MgResourceIdentifier::CheckRepositoryName()[[BR]]
 {[[BR]]
    ...[[BR]]
         MgUtil::CheckSpacesAtBeginEnd(m_repositoryName);[[BR]]
         MgUtil::CheckReservedCharacters(m_repositoryName,
 MgReservedCharacterSet::Name);[[BR]]
    ...[[BR]]
 }[[BR]]
 void MgResourceIdentifier::CheckPath()[[BR]]
 {[[BR]]
     ...[[BR]]
         MgUtil::CheckSpacesAtBeginEnd(m_path);[[BR]]
         MgUtil::CheckReservedCharacters(m_path,
 MgReservedCharacterSet::Path);[[BR]]
         MgUtil::CheckReservedCharacters(m_path, L"//", false);[[BR]]
         MgUtil::CheckReservedCharacters(m_path, L" /", false);[[BR]]
         MgUtil::CheckReservedCharacters(m_path, L"/ ", false);[[BR]]
         MgUtil::CheckSlashAtBeginEnd(m_path);[[BR]]
     ...[[BR]]
 }[[BR]]
 void MgResourceIdentifier::CheckName()[[BR]]
 {[[BR]]
    ...[[BR]]
         MgUtil::CheckSpacesAtBeginEnd(m_name);[[BR]]
         MgUtil::CheckReservedCharacters(m_name,
 MgReservedCharacterSet::Name);[[BR]]
    ...[[BR]]
 }[[BR]]
 void MgResourceIdentifier::CheckType(CREFSTRING repositoryType,
     CREFSTRING resourceType)[[BR]]
 {[[BR]]
    ...[[BR]]
         MgUtil::CheckSpacesAtBeginEnd(resourceType);[[BR]]
         MgUtil::CheckReservedCharacters(resourceType,
 MgReservedCharacterSet::Name);[[BR]]
    ...[[BR]]
 }[[BR]]
 Interesting, they all have MgUtil::CheckSpacesAtBeginEnd() before
 MgUtil::CheckReservedCharacters().

 2. Configuration.cpp[[BR]]
 void MgConfiguration::ValidateValue(CREFSTRING section, CREFSTRING
 property,
     CREFSTRING value)[[BR]]
 {[[BR]]
     ...[[BR]]
     MgUtil::CheckReservedCharacters(value, sm_reservedCharacters);[[BR]]
     MgUtil::CheckReservedCharacters(property,
 sm_reservedCharacters);[[BR]]
     MgUtil::CheckReservedCharacters(section, sm_reservedCharacters);[[BR]]
     ...[[BR]]
 }[[BR]]
 To minimize the change, I prefer to add MgUtil::CheckSpacesAtBeginEnd()
 for property
 and section.

 Please see the new attached patch
 http://trac.osgeo.org/mapguide/attachment/ticket/1057/RemoveSpaceCheck%28II%29.patch.

 It's appreciated if someone could submit it :)

 Replying to [comment:3 trevorwekel]:
 > Hi Christine,
 >
 > I would simply remove the !CheckSpacesAtBeginEnd() call from the code
 instead of commenting it out.
 >
 > Did you also validate all calls to !CheckReservedCharacters() to ensure
 that removing the space check would have no side effects?

-- 
Ticket URL: <http://trac.osgeo.org/mapguide/ticket/1057#comment:4>
MapGuide Open Source <http://mapguide.osgeo.org/>
MapGuide Open Source Internals


More information about the mapguide-trac mailing list