From b99ed41c94c5a1966a863d1182776ac796613c1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Magnus=20M=C3=A5nsson?= Date: Fri, 7 Feb 2020 05:20:53 +0100 Subject: [PATCH] Implemented param char ssb and sse (#58) --- db.class.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/db.class.php b/db.class.php index 54baca4..48ca060 100644 --- a/db.class.php +++ b/db.class.php @@ -443,7 +443,9 @@ class MeekroDB { $this->param_char . 'hc', // hash `key`='value' pairs separated by commas $this->param_char . 'ha', // hash `key`='value' pairs separated by and $this->param_char . 'ho', // hash `key`='value' pairs separated by or - $this->param_char . 'ss' // search string (like string, surrounded with %'s) + $this->param_char . 'ss', // search string (like string, surrounded with %'s) + $this->param_char . 'ssb', // search string (like, begins with) + $this->param_char . 'sse', // search string (like, ends with) ); // generate list of all MeekroDB variables in our query, and their position @@ -603,6 +605,8 @@ class MeekroDB { else if ($type == 'b') $result = $this->formatTableName($arg); else if ($type == 'l') $result = $arg; else if ($type == 'ss') $result = $this->escape("%" . str_replace(array('%', '_'), array('\%', '\_'), $arg) . "%"); + else if ($type == 'ssb') $result = $this->escape(str_replace(array('%', '_'), array('\%', '\_'), $arg) . "%"); + else if ($type == 'sse') $result = $this->escape("%" . str_replace(array('%', '_'), array('\%', '\_'), $arg)); else if ($type == 't') $result = $this->escape($this->parseTS($arg)); else if ($type == 'ls') $result = array_map(array($this, 'escape'), $arg);