From 7fa39584ac0b7a750f6d17447bf2e8943cada139 Mon Sep 17 00:00:00 2001 From: M.Gergo Date: Mon, 6 Apr 2020 01:23:00 +0200 Subject: Mayor-Nextcloud script: Tankörmappák userek --- "egy\303\251b/nextcloud/mayor-nextcloud.php" | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'egyéb') diff --git "a/egy\303\251b/nextcloud/mayor-nextcloud.php" "b/egy\303\251b/nextcloud/mayor-nextcloud.php" index 9f054c98..936ed081 100644 --- "a/egy\303\251b/nextcloud/mayor-nextcloud.php" +++ "b/egy\303\251b/nextcloud/mayor-nextcloud.php" @@ -114,14 +114,20 @@ if (function_exists('mysqli_connect') and PHP_MAJOR_VERSION >= 7) { //MySQLi (Im } } + function rmnp($str){ //Remove non-printable + return preg_replace('/[\x00-\x1F\x7F-\xA0\xAD]/u', '', $str); + } + function escp($str){ //Escape strings $str = str_replace(array("\\","`", "\'", "\"" ),array("\\\\", "\`", "\\\'", "\\\""), $str); return escapeshellarg($str); } function rnescp($str){ //Escape strings - str_replace(array("\\","`", "\'", "\"", "\ ", ), array("_", "", "", "", "_", ), $str); - return substr(escapeshellarg($str), 1, -1); + $str = rmnp($str); + $str = escapeshellarg($str); + $str = str_replace(array("\\", "`", "'", "\"", "\ ", ), array("", "", "", "", "_", ), $str); + return $str; } function nxt_get_version(){ -- cgit v1.2.3