From: Mattias Michaux Date: Fri, 29 Apr 2016 05:45:10 +0000 (+0200) Subject: Removed obsolete MysqlColumnNameLoose validate and escape check. X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=ee8d138d725c52b3b1702d0f0ad13a4657ae1c9a;p=civicrm-core.git Removed obsolete MysqlColumnNameLoose validate and escape check. --- diff --git a/CRM/Utils/Rule.php b/CRM/Utils/Rule.php index 00af967bd3..3251d26bbe 100644 --- a/CRM/Utils/Rule.php +++ b/CRM/Utils/Rule.php @@ -87,26 +87,6 @@ class CRM_Utils_Rule { return TRUE; } - /** - * @param $str - * - * @return bool - */ - public static function mysqlColumnNameLoose($str) { - // Check the length. - // This check is incorrect for the . format, which can be - // a problem. - // But is quit difficult to check, as a dot is also a valid character in a - // column name. In that case backticks are needed, which will - // be escaped in the escape function, which lead to an icorrect name... - // So this function assumes there is only a column name. - if (empty($str) || strlen($str) > 64) { - return FALSE; - } - - return TRUE; - } - /** * Validate an acceptable column name for sorting results. * diff --git a/CRM/Utils/Type.php b/CRM/Utils/Type.php index 8bbdb8cb61..7eb4da56f4 100644 --- a/CRM/Utils/Type.php +++ b/CRM/Utils/Type.php @@ -268,15 +268,6 @@ class CRM_Utils_Type { } break; - case 'MysqlColumnNameLoose': - if (CRM_Utils_Rule::mysqlColumnNameLoose($data)) { - $parts = explode('.', str_replace('`', '``', $data)); - $data = '`'.implode('`.`', $parts).'`'; - - return $data; - } - break; - case 'MysqlColumnName': if (CRM_Utils_Rule::mysqlColumnName($data)) { $parts = explode('.', $data); @@ -405,12 +396,6 @@ class CRM_Utils_Type { } break; - case 'MysqlColumnNameLoose': - if (CRM_Utils_Rule::mysqlColumnNameLoose($data)) { - return data; - } - break; - case 'MysqlColumnName': if (CRM_Utils_Rule::mysqlColumnName($data)) { return $data;