Changeset 747


Ignore:
Timestamp:
Aug 27, 2021 2:27:14 AM (3 years ago)
Author:
anonymous
Message:

Set default mysql connection charset to utf8mb4

Location:
trunk/lib
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/App.inc.php

    r746 r747  
    14941494     *                                          -false  <-- To not carry any queries. If URL already has queries those will be retained.
    14951495     * @param   bool    $always_include_sid     Force session id to be added to Location header.
    1496      */
    1497     public function dieURL($url, $carry_args=null, $always_include_sid=false)
     1496     * @param   int     $http_response_code     The HTTP response code to include with the Location header. Use 303 when the redirect should be GET, or
     1497     *                                          use 307 when the redirect should use the same method as the original request.
     1498     */
     1499    public function dieURL($url, $carry_args=null, $always_include_sid=false, $http_response_code=303)
    14981500    {
    14991501        if (!$this->running) {
     
    15091511        $url = $this->url($url, $carry_args, $always_include_sid);
    15101512
    1511         // Should we send a "303 See Other" header here instead of relying on the 302 sent automatically by PHP?
    15121513        if (!headers_sent($h_file, $h_line)) {
    1513             header(sprintf('Location: %s', $url));
     1514            header(sprintf('Location: %s', $url), true, $http_response_code);
    15141515            $this->logMsg(sprintf('dieURL: %s', $url), LOG_DEBUG, __FILE__, __LINE__);
    15151516        } else {
  • trunk/lib/DBSessionHandler.inc.php

    r728 r747  
    112112                PRIMARY KEY `session_id` (`session_id`),
    113113                KEY `last_access` (`last_access`)
    114             ) ENGINE=InnoDB DEFAULT CHARSET=utf8");
     114            ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4");
    115115
    116116            if (!$this->db->columnExists($this->_params['db_table'], array(
  • trunk/lib/PDO.inc.php

    r733 r747  
    8888    // Translate between HTML and MySQL character set names.
    8989    public $mysql_character_sets = array(
    90         'utf-8' => 'utf8',
     90        'utf-8' => 'utf8mb4',
    9191        'iso-8859-1' => 'latin1',
    9292    );
     
    255255    public function close()
    256256    {
    257         $app =& App::getInstance();
    258 
    259         if (!$this->_connected) {
    260             throw new \Exception(sprintf('No DB connection to run %s', __METHOD__));
    261         }
    262 
    263257        $this->_connected = false;
    264258        $this->dbh = null;
  • trunk/lib/Utilities.inc.php

    r746 r747  
    10871087 * quotes if necessary.
    10881088 *
    1089  * @param string $key (optional) The name of a $_REQUEST key.
    1090  * @param string $default (optional) The value to return if the
    1091  *                                   variable is not there.
     1089 * @param string $key       The name of a $_REQUEST key (optional).
     1090 * @param string $default   The value to return if the variable is set (optional).
    10921091 * @return mixed      A cleaned GET or POST array if no key specified.
    1093  * @return string     A cleaned form value if found, or $default.
     1092 * @return string     A cleaned form value if set, or $default.
    10941093 */
    10951094function getFormData($key=null, $default=null)
Note: See TracChangeset for help on using the changeset viewer.