return TRUE;
}
- /**
- * @param $str
- *
- * @return bool
- */
- public static function mysqlColumnNameLoose($str) {
- // Check the length.
- // This check is incorrect for the <table>.<column> 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.
*
}
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);
}
break;
- case 'MysqlColumnNameLoose':
- if (CRM_Utils_Rule::mysqlColumnNameLoose($data)) {
- return data;
- }
- break;
-
case 'MysqlColumnName':
if (CRM_Utils_Rule::mysqlColumnName($data)) {
return $data;