Changeset 22650

Show
Ignore:
Timestamp:
17.08.2010 16:33:13 (9 years ago)
Author:
mdewsnip
Message:

Added new "dmsafe:" format statement modifier, in preparation for removing dmsafe() calls from the build time code. This shouldn't be done in the build time code because it is a runtime issue -- if you aren't using the Greenstone 2 receptionist (e.g OAI server, Greenstone 3) then escaping underscores just creates problems.

Location:
main/trunk/greenstone2/runtime-src/src/recpt
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/runtime-src/src/recpt/formattools.cpp

    r22437 r22650  
    2626#include "formattools.h" 
    2727#include "cgiutils.h" 
     28#include "gsdltools.h" 
    2829#include "recptprototools.h" 
    2930#include "OIDtools.h" 
     
    548549      keep_trying = true; 
    549550    } 
     551    // New "dmsafe" special formatting option 
     552    if (meta.size() > ((text_t) "dmsafe:").size() && starts_with(meta, "dmsafe:")) 
     553    { 
     554      metaoption.metacommand |= mDMSafe; 
     555      meta = substr(meta.begin() + ((text_t) "dmsafe:").size(), meta.end()); 
     556      keep_trying = true; 
     557    } 
    550558  } 
    551559 
     
    10761084    fresh_metatext = text_html_safe; 
    10771085      } 
     1086      // New "dmsafe" special formatting option 
     1087      if (meta.metacommand & mDMSafe) 
     1088      { 
     1089    // Make it macro-safe 
     1090    text_t text_dm_safe = dm_safe(fresh_metatext); 
     1091    fresh_metatext = text_dm_safe; 
     1092      } 
    10781093 
    10791094      if (metadata_spanwrap) { 
     
    11451160      } 
    11461161      fresh_metatext = text_html_safe; 
     1162    } 
     1163    // New "dmsafe" special formatting option 
     1164    if (meta.metacommand & mDMSafe) 
     1165    { 
     1166      // Make it macro-safe 
     1167      text_t text_dm_safe = dm_safe(fresh_metatext); 
     1168      fresh_metatext = text_dm_safe; 
    11471169    } 
    11481170 
  • main/trunk/greenstone2/runtime-src/src/recpt/formattools.h

    r21808 r22650  
    4141        comAssocLink, comEndAssocLink}; 
    4242 
    43 enum mcommand_t {mNone=0, mCgiSafe=1, mParent=2, mSibling=4, mChild=8, mSpecial=16, mTruncate=32, mXMLSafe=64, mHTMLSafe=128}; 
     43enum mcommand_t {mNone=0, mCgiSafe=1, mParent=2, mSibling=4, mChild=8, mSpecial=16, mTruncate=32, mXMLSafe=64, mHTMLSafe=128, mDMSafe=256}; 
    4444 
    4545enum pcommand_t {pNone, pImmediate, pTop, pAll};