Textpattern PHP Cross Reference Content Management Systems

Source: /textpattern/update/_to_4.0.6.php - 44 lines - 1580 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  // Replace deprecated tags with functionally equivalent, valid tags.
  29  $tags = array(
  30      'sitename'    => 'site_name',
  31      'request_uri' => 'page_url',
  32      'id'          => 'page_url type="id"',
  33      's'           => 'page_url type="s"',
  34      'c'           => 'page_url type="c"',
  35      'q'           => 'page_url type="q"',
  36      'pg'          => 'page_url type="pg"',
  37  );
  38  
  39  foreach ($tags as $search => $replace) {
  40      foreach (array(' ', '/') as $end) {
  41          safe_update('txp_page', "user_html = REPLACE(user_html, '<txp:".$search.$end."', '<txp:".$replace.' '.trim($end)."')", "1 = 1");
  42          safe_update('txp_form', "Form = REPLACE(Form, '<txp:".$search.$end."', '<txp:".$replace.' '.trim($end)."')", "1 = 1");
  43      }
  44  }

title

Description

title

Description

title

Description

title

title

Body