Search code examples
phputf-8opencartopencart-3

OpenCart installation, cannot log into Dashboard


I just installed OpenCart on my website. When i try to log into the dashboard, i get the following error:

Warning: htmlspecialchars(): charset `UTF-8;' not supported, assuming utf-8 in /home/********/public_html/system/library/cart/user.php on line 39

Warning: Cannot modify header information - headers already sent by (output started at /home/********/public_html/admin/controller/startup/error.php:34) in /home/********/public_html/system/library/response.php on line 12

This is the function for the login:

    public function login($username, $password) {
    $user_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "user WHERE username = '" . $this->db->escape($username) . "' AND (password = SHA1(CONCAT(salt, SHA1(CONCAT(salt, SHA1('" . $this->db->escape(htmlspecialchars($password, ENT_QUOTES)) . "'))))) OR password = '" . $this->db->escape(md5($password)) . "') AND status = '1'");

I haven't installed anything except the platform. Is there anything else I should do before logging ? If the files are UTF-8, do I need to re-save everything and re-upload them on the server ? I read on the forums that OC supports UTF-8 so I don't know why it brings up this error.


Solution

  • Quick Fix:

    Remove following line from /admin/view/template/common/header.tpl on line 7

    <meta charset="UTF-8" />