Textpattern PHP Cross Reference Content Management Systems

Source: /textpattern/update/_to_4.3.0.php - 41 lines - 1364 bytes - Text - Print

   1  <?php
   2  
   3  /*
   4   * Textpattern Content Management System
   5   * https://textpattern.com/
   6   *
   7   * Copyright (C) 2020 The Textpattern Development Team
   8   *
   9   * This file is part of Textpattern.
  10   *
  11   * Textpattern is free software; you can redistribute it and/or
  12   * modify it under the terms of the GNU General Public License
  13   * as published by the Free Software Foundation, version 2.
  14   *
  15   * Textpattern is distributed in the hope that it will be useful,
  16   * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18   * GNU General Public License for more details.
  19   *
  20   * You should have received a copy of the GNU General Public License
  21   * along with Textpattern. If not, see <https://www.gnu.org/licenses/>.
  22   */
  23  
  24  if (!defined('TXP_UPDATE')) {
  25      exit("Nothing here. You can't access this file directly.");
  26  }
  27  
  28  $rs = getRows("SELECT name, css FROM `".PFX."txp_css`");
  29  foreach ($rs as $row) {
  30      if (preg_match('%^[a-zA-Z0-9/+]*={0,2}$%', $row['css'])) {
  31          // Data is still base64 encoded.
  32          safe_update('txp_css', "css = '".doSlash(base64_decode($row['css']))."'", "name = '".doSlash($row['name'])."'");
  33      }
  34  }
  35  
  36  // Add column for file title.
  37  $cols = getThings("DESCRIBE `".PFX."txp_file`");
  38  
  39  if (!in_array('title', $cols)) {
  40      safe_alter('txp_file', "ADD title VARCHAR(255) NULL AFTER filename");
  41  }

title

Description

title

Description

title

Description

title

title

Body