Ignore:
Timestamp:
2010-08-17T16:33:13+12:00 (14 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.

File:
1 edited

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
Note: See TracChangeset for help on using the changeset viewer.