Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/ExeBy/smexe_ro.../var/softacul.../txtpat
File: index.php
<?php
[0] Fix | Delete
[1] Fix | Delete
/*
[2] Fix | Delete
* Textpattern Content Management System
[3] Fix | Delete
* https://textpattern.com/
[4] Fix | Delete
*
[5] Fix | Delete
* Copyright (C) 2022 The Textpattern Development Team
[6] Fix | Delete
*
[7] Fix | Delete
* This file is part of Textpattern.
[8] Fix | Delete
*
[9] Fix | Delete
* Textpattern is free software; you can redistribute it and/or
[10] Fix | Delete
* modify it under the terms of the GNU General Public License
[11] Fix | Delete
* as published by the Free Software Foundation, version 2.
[12] Fix | Delete
*
[13] Fix | Delete
* Textpattern is distributed in the hope that it will be useful,
[14] Fix | Delete
* but WITHOUT ANY WARRANTY; without even the implied warranty of
[15] Fix | Delete
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
[16] Fix | Delete
* GNU General Public License for more details.
[17] Fix | Delete
*
[18] Fix | Delete
* You should have received a copy of the GNU General Public License
[19] Fix | Delete
* along with Textpattern. If not, see <https://www.gnu.org/licenses/>.
[20] Fix | Delete
*/
[21] Fix | Delete
[22] Fix | Delete
if (!defined('txpath')) {
[23] Fix | Delete
define("txpath", dirname(__FILE__));
[24] Fix | Delete
}
[25] Fix | Delete
[26] Fix | Delete
define("txpinterface", "admin");
[27] Fix | Delete
[28] Fix | Delete
$thisversion = '4.8.8';
[29] Fix | Delete
// $txp_using_svn deprecated in 4.7.0.
[30] Fix | Delete
$txp_using_svn = $txp_is_dev = false; // Set false for releases.
[31] Fix | Delete
[32] Fix | Delete
ob_start(null, 2048);
[33] Fix | Delete
[34] Fix | Delete
if (!isset($txpcfg['table_prefix']) && !@include './config.php') {
[35] Fix | Delete
ob_end_clean();
[36] Fix | Delete
header('HTTP/1.1 503 Service Unavailable');
[37] Fix | Delete
exit('<p>config.php is missing or corrupt. To install Textpattern, visit <a href="./setup/">setup</a>.</p>');
[38] Fix | Delete
} else {
[39] Fix | Delete
ob_end_clean();
[40] Fix | Delete
}
[41] Fix | Delete
[42] Fix | Delete
header("Content-Type: text/html; charset=utf-8");
[43] Fix | Delete
[44] Fix | Delete
error_reporting(E_ALL | E_STRICT);
[45] Fix | Delete
@ini_set("display_errors", "1");
[46] Fix | Delete
include txpath.'/lib/class.trace.php';
[47] Fix | Delete
$trace = new Trace();
[48] Fix | Delete
$trace->start('[PHP includes]');
[49] Fix | Delete
include_once txpath.'/lib/constants.php';
[50] Fix | Delete
include txpath.'/lib/txplib_misc.php';
[51] Fix | Delete
include txpath.'/lib/txplib_admin.php';
[52] Fix | Delete
[53] Fix | Delete
include txpath.'/vendors/Textpattern/Loader.php';
[54] Fix | Delete
[55] Fix | Delete
$loader = new \Textpattern\Loader(txpath.'/vendors');
[56] Fix | Delete
$loader->register();
[57] Fix | Delete
[58] Fix | Delete
$loader = new \Textpattern\Loader(txpath.'/lib');
[59] Fix | Delete
$loader->register();
[60] Fix | Delete
[61] Fix | Delete
include txpath.'/lib/txplib_db.php';
[62] Fix | Delete
include txpath.'/lib/txplib_forms.php';
[63] Fix | Delete
include txpath.'/lib/txplib_html.php';
[64] Fix | Delete
include txpath.'/lib/admin_config.php';
[65] Fix | Delete
$trace->stop();
[66] Fix | Delete
[67] Fix | Delete
set_error_handler('adminErrorHandler', error_reporting());
[68] Fix | Delete
[69] Fix | Delete
if ($connected && numRows(safe_query("SHOW TABLES LIKE '".PFX."textpattern'"))) {
[70] Fix | Delete
// Global site preferences.
[71] Fix | Delete
$prefs = get_prefs();
[72] Fix | Delete
extract($prefs);
[73] Fix | Delete
[74] Fix | Delete
if (empty($siteurl)) {
[75] Fix | Delete
$httphost = preg_replace('/[^-_a-zA-Z0-9.:]/', '', $_SERVER['HTTP_HOST']);
[76] Fix | Delete
$prefs['siteurl'] = $siteurl = $httphost.rtrim(dirname(dirname($_SERVER['SCRIPT_NAME'])), DS);
[77] Fix | Delete
}
[78] Fix | Delete
[79] Fix | Delete
if (empty($path_to_site)) {
[80] Fix | Delete
updateSitePath(dirname(dirname(__FILE__)));
[81] Fix | Delete
}
[82] Fix | Delete
[83] Fix | Delete
define('TXP_PATTERN', get_pref('enable_short_tags', false) ? 'txp|[a-z]+:' : 'txp:?');
[84] Fix | Delete
define("LANG", $language);
[85] Fix | Delete
define('txp_version', $thisversion);
[86] Fix | Delete
[87] Fix | Delete
if (!defined('PROTOCOL')) {
[88] Fix | Delete
switch (serverSet('HTTPS')) {
[89] Fix | Delete
case '':
[90] Fix | Delete
case 'off': // ISAPI with IIS.
[91] Fix | Delete
define('PROTOCOL', 'http://');
[92] Fix | Delete
break;
[93] Fix | Delete
default:
[94] Fix | Delete
define('PROTOCOL', 'https://');
[95] Fix | Delete
break;
[96] Fix | Delete
}
[97] Fix | Delete
}
[98] Fix | Delete
[99] Fix | Delete
define('hu', PROTOCOL.$siteurl.'/');
[100] Fix | Delete
[101] Fix | Delete
// Relative URL global.
[102] Fix | Delete
define('rhu', preg_replace('|^https?://[^/]+|', '', hu));
[103] Fix | Delete
[104] Fix | Delete
// HTTP address of the site serving images.
[105] Fix | Delete
if (!defined('ihu')) {
[106] Fix | Delete
define('ihu', hu);
[107] Fix | Delete
}
[108] Fix | Delete
[109] Fix | Delete
// HTTP address of Textpattern admin URL.
[110] Fix | Delete
if (!defined('ahu')) {
[111] Fix | Delete
if (empty($txpcfg['admin_url'])) {
[112] Fix | Delete
$adminurl = hu.'textpattern/';
[113] Fix | Delete
} else {
[114] Fix | Delete
$adminurl = PROTOCOL.rtrim(preg_replace('|^https?://|', '', $txpcfg['admin_url']), '/').'/';
[115] Fix | Delete
}
[116] Fix | Delete
[117] Fix | Delete
define('ahu', $adminurl);
[118] Fix | Delete
}
[119] Fix | Delete
[120] Fix | Delete
// Shared admin and public cookie_domain when using multisite admin URL (use main domain if not set).
[121] Fix | Delete
if (!defined('cookie_domain')) {
[122] Fix | Delete
if (!isset($txpcfg['cookie_domain'])) {
[123] Fix | Delete
if (empty($txpcfg['admin_url'])) {
[124] Fix | Delete
$txpcfg['cookie_domain'] = '';
[125] Fix | Delete
} else {
[126] Fix | Delete
$txpcfg['cookie_domain'] = rtrim(substr($txpcfg['admin_url'], strpos($txpcfg['admin_url'], '.') + 1), '/');
[127] Fix | Delete
}
[128] Fix | Delete
}
[129] Fix | Delete
[130] Fix | Delete
define('cookie_domain', $txpcfg['cookie_domain']);
[131] Fix | Delete
}
[132] Fix | Delete
[133] Fix | Delete
if (!empty($locale)) {
[134] Fix | Delete
setlocale(LC_ALL, $locale);
[135] Fix | Delete
}
[136] Fix | Delete
[137] Fix | Delete
// For backwards-compatibility (sort of) with plugins that expect the
[138] Fix | Delete
// $textarray global to be present.
[139] Fix | Delete
// Will remove in future.
[140] Fix | Delete
$textarray = array();
[141] Fix | Delete
[142] Fix | Delete
//load_lang(LANG, 'admin');
[143] Fix | Delete
[144] Fix | Delete
// Initialise global theme.
[145] Fix | Delete
$theme = \Textpattern\Admin\Theme::init();
[146] Fix | Delete
[147] Fix | Delete
include txpath.'/include/txp_auth.php';
[148] Fix | Delete
doAuth();
[149] Fix | Delete
[150] Fix | Delete
// Add private preferences.
[151] Fix | Delete
$prefs += get_prefs($txp_user);
[152] Fix | Delete
plug_privs();
[153] Fix | Delete
extract($prefs);
[154] Fix | Delete
[155] Fix | Delete
$dbversion = $version;
[156] Fix | Delete
[157] Fix | Delete
$event = (gps('event') ? trim(gps('event')) : (!empty($default_event) && has_privs($default_event) ? $default_event : 'article'));
[158] Fix | Delete
$step = trim(gps('step'));
[159] Fix | Delete
$app_mode = trim(gps('app_mode'));
[160] Fix | Delete
[161] Fix | Delete
/**
[162] Fix | Delete
* @ignore
[163] Fix | Delete
*/
[164] Fix | Delete
[165] Fix | Delete
define('SITE_HOST', (string) @parse_url(hu, PHP_URL_HOST));
[166] Fix | Delete
[167] Fix | Delete
/**
[168] Fix | Delete
* @ignore
[169] Fix | Delete
*/
[170] Fix | Delete
[171] Fix | Delete
define('IMPATH', $path_to_site.DS.$img_dir.DS);
[172] Fix | Delete
[173] Fix | Delete
if (!$dbversion || ($dbversion != $thisversion) || $txp_is_dev) {
[174] Fix | Delete
define('TXP_UPDATE', 1);
[175] Fix | Delete
include txpath.'/update/_update.php';
[176] Fix | Delete
}
[177] Fix | Delete
[178] Fix | Delete
janitor();
[179] Fix | Delete
[180] Fix | Delete
// Article or form preview.
[181] Fix | Delete
if (isset($_GET['txpreview'])) {
[182] Fix | Delete
load_lang(LANG, 'public');
[183] Fix | Delete
include txpath.'/publish.php';
[184] Fix | Delete
textpattern();
[185] Fix | Delete
echo $trace->summary();
[186] Fix | Delete
[187] Fix | Delete
if ($production_status === 'debug') {
[188] Fix | Delete
echo $trace->result();
[189] Fix | Delete
}
[190] Fix | Delete
[191] Fix | Delete
exit;
[192] Fix | Delete
}
[193] Fix | Delete
[194] Fix | Delete
$txp_sections = safe_column(array('name'), 'txp_section', '1 ORDER BY title, name');
[195] Fix | Delete
$timezone_key = get_pref('timezone_key', date_default_timezone_get()) or $timezone_key = 'UTC';
[196] Fix | Delete
date_default_timezone_set($timezone_key);
[197] Fix | Delete
[198] Fix | Delete
// Reload string pack using per-user language.
[199] Fix | Delete
$lang_ui = (empty($language_ui)) ? $language : $language_ui;
[200] Fix | Delete
load_lang($lang_ui, $event);
[201] Fix | Delete
[202] Fix | Delete
if ($lang_ui != $language) {
[203] Fix | Delete
Txp::get('\Textpattern\L10n\Locale')->setLocale(LC_ALL, $lang_ui);
[204] Fix | Delete
}
[205] Fix | Delete
[206] Fix | Delete
// Register modules
[207] Fix | Delete
register_callback('\Textpattern\Module\Help\HelpAdmin::init', 'help');
[208] Fix | Delete
[209] Fix | Delete
if (!empty($admin_side_plugins) and gps('event') != 'plugin') {
[210] Fix | Delete
load_plugins(1);
[211] Fix | Delete
}
[212] Fix | Delete
[213] Fix | Delete
// Plugins may have altered privilege settings.
[214] Fix | Delete
if (!defined('TXP_UPDATE_DONE') && !gps('event') && !empty($default_event) && has_privs($default_event)) {
[215] Fix | Delete
$event = $default_event;
[216] Fix | Delete
}
[217] Fix | Delete
[218] Fix | Delete
// Initialise private theme.
[219] Fix | Delete
$theme = \Textpattern\Admin\Theme::init();
[220] Fix | Delete
[221] Fix | Delete
include txpath.'/lib/txplib_head.php';
[222] Fix | Delete
[223] Fix | Delete
require_privs($event);
[224] Fix | Delete
callback_event($event, $step, 1);
[225] Fix | Delete
$inc = txpath.'/include/txp_'.$event.'.php';
[226] Fix | Delete
[227] Fix | Delete
if (is_readable($inc)) {
[228] Fix | Delete
include($inc);
[229] Fix | Delete
}
[230] Fix | Delete
[231] Fix | Delete
callback_event($event, $step, 0);
[232] Fix | Delete
[233] Fix | Delete
end_page();
[234] Fix | Delete
[235] Fix | Delete
if ($production_status !== 'live') {
[236] Fix | Delete
if ($app_mode != 'async') {
[237] Fix | Delete
echo $trace->summary();
[238] Fix | Delete
[239] Fix | Delete
if ($production_status === 'debug') {
[240] Fix | Delete
echo $trace->result();
[241] Fix | Delete
}
[242] Fix | Delete
} else {
[243] Fix | Delete
foreach ($trace->summary(true) as $key => $value) {
[244] Fix | Delete
header('X-Textpattern-'.preg_replace('/[^\w]+/', '', $key).': '.$value);
[245] Fix | Delete
}
[246] Fix | Delete
}
[247] Fix | Delete
}
[248] Fix | Delete
} else {
[249] Fix | Delete
txp_die(
[250] Fix | Delete
'Database connection was successful, but the <code>textpattern</code> table was not found.',
[251] Fix | Delete
'503 Service Unavailable'
[252] Fix | Delete
);
[253] Fix | Delete
}
[254] Fix | Delete
[255] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function