Textpattern PHP Cross Reference Content Management Systems

Source: /css.php - 102 lines - 2575 bytes - Summary - Text - Print

Description: Outputs CSS files.

   1  <?php
   2  
   3  /*
   4   * Textpattern Content Management System
   5   * http://textpattern.com
   6   *
   7   * Copyright (C) 2016 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 <http://www.gnu.org/licenses/>.
  22   */
  23  
  24  /**
  25   * Outputs CSS files.
  26   *
  27   * @since 4.2.0
  28   */
  29  
  30  if (@ini_get('register_globals')) {
  31      if (isset($_REQUEST['GLOBALS']) || isset($_FILES['GLOBALS'])) {
  32          die('GLOBALS overwrite attempt detected. Please consider turning register_globals off.');
  33      }
  34  
  35      // Collect and unset all registered variables from globals.
  36      $_txpg = array_merge(
  37          isset($_SESSION) ? (array) $_SESSION : array(),
  38          (array) $_ENV,
  39          (array) $_GET,
  40          (array) $_POST,
  41          (array) $_COOKIE,
  42          (array) $_FILES,
  43          (array) $_SERVER);
  44  
  45      // As the deliberate awkwardly-named local variable $_txpfoo MUST NOT be
  46      // unset to avoid notices further down, we must remove any potential
  47      // identically-named global from the list of global names here.
  48      unset($_txpg['_txpfoo']);
  49  
  50      foreach ($_txpg as $_txpfoo => $value) {
  51          if (!in_array($_txpfoo, array(
  52              'GLOBALS',
  53              '_SERVER',
  54              '_GET',
  55              '_POST',
  56              '_FILES',
  57              '_COOKIE',
  58              '_SESSION',
  59              '_REQUEST',
  60              '_ENV',
  61          ))) {
  62              unset($GLOBALS[$_txpfoo], $$_txpfoo);
  63          }
  64      }
  65  }
  66  
  67  header('Content-type: text/css');
  68  
  69  if (!defined("txpath")) {
  70      /**
  71       * @ignore
  72       */
  73  
  74      define("txpath", dirname(__FILE__).'/textpattern');
  75  }
  76  
  77  if (!isset($txpcfg['table_prefix'])) {
  78      ob_start(null, 2048);
  79      include txpath.'/config.php';
  80      ob_end_clean();
  81  }
  82  
  83  include txpath.'/lib/class.trace.php';
  84  $trace = new Trace();
  85  include txpath.'/lib/constants.php';
  86  include txpath.'/lib/txplib_misc.php';
  87  
  88  $nolog = 1;
  89  
  90  /**
  91   * @ignore
  92   */
  93  
  94  define("txpinterface", "css");
  95  include txpath.'/publish.php';
  96  $s = gps('s');
  97  $n = gps('n');
  98  output_css($s, $n);
  99  
 100  if ($production_status === 'debug') {
 101      echo n.'/*' . $trace->result() . n.'*/'.n;
 102  }

title

Description

title

Description

title

Description

title

title

Body