Beispiel #1
0
 /**
  * Returns a value string ready to be put inside quotes, with quotes and percent escaped.
  * 
  * <code>
  * $this->db->escape_value("L'infanzia di \"maria\"");
  * </code>
  * 
  * @param string $value The string to escape.
  * 
  * @return string | false
  */
 public function escape_value($value, $esc = "'")
 {
     if (is_string($value)) {
         return str_replace('%', '\\%', $esc === '"' ? \bbn\str\text::escape_dquotes($value) : \bbn\str\text::escape_squotes($value));
     }
     return $value;
 }
Beispiel #2
0
 public function ele_and_script()
 {
     return ['$(\'' . \bbn\str\text::escape_squotes($this->html()) . '\')', $this->script(false)];
 }