You are here

function socialcalc_decode_value in Sheetnode 7

Same name and namespace in other branches
  1. 5 socialcalc.inc \socialcalc_decode_value()
  2. 6 socialcalc.inc \socialcalc_decode_value()
  3. 7.2 socialcalc.inc \socialcalc_decode_value()
3 calls to socialcalc_decode_value()
socialcalc_parse_cell in ./socialcalc.inc
socialcalc_parse_cell_value in ./socialcalc.inc
socialcalc_parse_sheet in ./socialcalc.inc

File

./socialcalc.inc, line 706
SocialCalc manipulation functions Translated from socialcalc-3.js and companion files

Code

function socialcalc_decode_value($s) {
  if (!is_string($s)) {
    return $s;
  }
  if (strstr($s, '\\') === FALSE) {
    return $s;
  }

  // for performace reasons: replace nothing takes up time
  $r = str_replace('\\c', ':', $s);
  $r = str_replace('\\n', "\n", $r);
  return str_replace('\\b', '\\', $r);
}