Permalink
Browse files

PSR-2 consistency

  • Loading branch information...
philwareham committed Oct 11, 2017
1 parent 6bad9b9 commit 6eff6978dacd6c76469041fa5a94e2476d42e172
View
@@ -107,11 +107,11 @@
include txpath.'/publish.php';
switch (txpinterface) {
case 'css' :
case 'css':
$n = gps('n');
output_css($s, $n);
break;
default :
default:
textpattern();
if ($production_status !== 'live') {
@@ -399,8 +399,8 @@ function doDiagnostics()
$gd_support[] = 'GIF';
}
// Aside: In PHP 5.3, they chose to add a previously unemployed capital
// "E" to the array key.
// Aside: In PHP 5.3, they chose to add a previously unemployed capital
// "E" to the array key.
if (!empty($gd_info['JPEG Support']) || !empty($gd_info['JPG Support'])) {
$gd_support[] = 'JPG';
}
@@ -670,7 +670,6 @@ function checkUpdates()
);
if (!empty($release)) {
if (version_compare($version, $release) < 0) {
$lastCheck['msg'] = gTxt('textpattern_update_available', array('{version}' => $release));
}
@@ -490,9 +490,9 @@
if (!defined('CONTENT_SECURITY_POLICY')) {
/**
* Sets Content-Security-Policy HTTP header's value.
*
*
* This constant can be overridden from the config.php.
*
*
* @since 4.7.0
* @package CSRF
*/
@@ -937,5 +937,5 @@
if (defined('JSON_UNESCAPED_UNICODE')) {
define('TEXTPATTERN_JSON', JSON_UNESCAPED_UNICODE);
} else {
define('TEXTPATTERN_JSON', 0);
define('TEXTPATTERN_JSON', 0);
}
@@ -770,4 +770,4 @@ function file_refactor(&$file)
}
return $file_array;
}
}
@@ -1839,7 +1839,7 @@ function doWrap($list, $wraptag, $break, $class = null, $breakclass = null, $att
extract($break + array('break' => ''));
}
foreach($import as $global) {
foreach ($import as $global) {
if (!isset($$global) && isset($txp_atts[$global])) {
$$global = $txp_atts[$global];
}
@@ -558,7 +558,9 @@ function processTags($tag, $atts = '', $thing = null)
$registry = Txp::get('\Textpattern\Tag\Registry');
$globals = array_filter(
$registry->getRegistered(true),
function($v) {return !is_bool($v);}
function ($v) {
return !is_bool($v);
}
);
}
@@ -5031,7 +5031,7 @@ function txp_escape($atts, $thing = '')
$function = function_exists('mb_strto'.$attr) ? 'mb_strto'.$attr : 'strto'.$attr;
$thing = $function($thing);
break;
case 'trim': case 'ltrim' : case 'rtrim' : case 'intval' :
case 'trim': case 'ltrim': case 'rtrim': case 'intval':
$thing = $attr($thing);
break;
case 'textile':
@@ -955,7 +955,7 @@ function get_public_themes_list()
$public_themes = $out = array();
if ($files = glob(txpath."/{setup,../themes/*}/manifest\.json", GLOB_BRACE)) {
foreach ($files as $file) {
foreach ($files as $file) {
$file = realpath($file);
if (preg_match('%^(.*/(\w+))/manifest\.json$%', $file, $mm) && $manifest = @json_decode(file_get_contents($file), true)) {
if (@$manifest['txp-type'] == 'textpattern-theme') {
@@ -114,8 +114,8 @@
// Load theme /data, /styles, /forms, /pages
if (class_exists('\Textpattern\Skin\Main') && $public_theme != 'setup') {
Txp::get('\Textpattern\Skin\Main', array($public_theme => array()))->import();
safe_update('txp_section', 'skin = "'.doSlash($public_theme).'"', '1=1');
Txp::get('\Textpattern\Skin\Main', array($public_theme => array()))->import();
safe_update('txp_section', 'skin = "'.doSlash($public_theme).'"', '1=1');
} else {
$themedir = $public_themes[$public_theme]['themedir'];
@@ -124,7 +124,7 @@
}
if ($files = glob("{$themedir}/forms/*/*\.txp")) {
foreach ($files as $file) {
foreach ($files as $file) {
if (preg_match('%/forms/(\w+)/(\w+)\.txp$%', $file, $mm)) {
$data = @file_get_contents($file);
safe_query("INSERT INTO `".PFX."txp_form`(type, name, Form) VALUES('".doSlash($mm[1])."', '".doSlash($mm[2])."', '".doSlash($data)."')");

0 comments on commit 6eff697

Please sign in to comment.