You are here

function Smarty::_dequote in Quiz 6.6

Same name and namespace in other branches
  1. 6.5 includes/moodle/lib/smarty/Smarty.class.php \Smarty::_dequote()

Remove starting and ending quotes from the string

Parameters

string $string:

Return value

string

4 calls to Smarty::_dequote()
Smarty_Compiler::_compile_foreach_start in includes/moodle/lib/smarty/Smarty_Compiler.class.php
Compile {foreach ...} tag.
Smarty_Compiler::_compile_include_php_tag in includes/moodle/lib/smarty/Smarty_Compiler.class.php
Compile {include ...} tag
Smarty_Compiler::_compile_insert_tag in includes/moodle/lib/smarty/Smarty_Compiler.class.php
Compile {insert ...} tag
Smarty_Compiler::_compile_registered_object_tag in includes/moodle/lib/smarty/Smarty_Compiler.class.php
compile a registered object tag

File

includes/moodle/lib/smarty/Smarty.class.php, line 1691

Class

Smarty
@package Smarty

Code

function _dequote($string) {
  if (($string[0] == "'" || $string[0] == '"') && $string[strlen($string) - 1] == $string[0]) {
    return substr($string, 1, -1);
  }
  else {
    return $string;
  }
}