change strlen to mb_strlen. Cause string in multibyte

parent 11edefc2
......@@ -116,13 +116,13 @@ function validate() {
return false;
}
if (strlen(getRequest('text', '')) < 5 || strlen(getRequest('text', '')) > 30) {
$error = sprintf($_language[$code_language]["error_text"], 5, 30, strlen(getRequest('text', '')));
if (mb_strlen(getRequest('text', '')) < 5 || mb_strlen(getRequest('text', '')) > 30) {
$error = sprintf($_language[$code_language]["error_text"], 5, 30, mb_strlen(getRequest('text', '')));
return false;
}
if (strlen(getRequest('comment', '')) > 30) {
$error = sprintf($_language[$code_language]["error_text"], 0, 30, strlen(getRequest('comment', '')));
if (mb_strlen(getRequest('comment', '')) > 30) {
$error = sprintf($_language[$code_language]["error_text"], 0, 30, mb_strlen(getRequest('comment', '')));
return false;
}
return true;
......
......@@ -212,8 +212,6 @@ class Typo extends CI_Model {
$this->db->where("id", $data['id_message']);
$this->db->where("site_id", $data['id_site']);
$this->db->update("messages");
log_message("error", "editMessage: {$this->db->last_query()}");
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment