Skip to content

Commit

Permalink
PSR-2 consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
philwareham committed Oct 11, 2017
1 parent 6bad9b9 commit 6eff697
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 16 deletions.
4 changes: 2 additions & 2 deletions index.php
Expand Up @@ -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') {
Expand Down
5 changes: 2 additions & 3 deletions textpattern/include/txp_diag.php
Expand Up @@ -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';
}
Expand Down Expand Up @@ -670,7 +670,6 @@ function checkUpdates()
);

if (!empty($release)) {

if (version_compare($version, $release) < 0) {
$lastCheck['msg'] = gTxt('textpattern_update_available', array('{version}' => $release));
}
Expand Down
6 changes: 3 additions & 3 deletions textpattern/lib/constants.php
Expand Up @@ -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
*/
Expand Down Expand Up @@ -937,5 +937,5 @@
if (defined('JSON_UNESCAPED_UNICODE')) {
define('TEXTPATTERN_JSON', JSON_UNESCAPED_UNICODE);
} else {
define('TEXTPATTERN_JSON', 0);
define('TEXTPATTERN_JSON', 0);
}
2 changes: 1 addition & 1 deletion textpattern/lib/txplib_forms.php
Expand Up @@ -770,4 +770,4 @@ function file_refactor(&$file)
}

return $file_array;
}
}
2 changes: 1 addition & 1 deletion textpattern/lib/txplib_html.php
Expand Up @@ -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];
}
Expand Down
4 changes: 3 additions & 1 deletion textpattern/lib/txplib_publish.php
Expand Up @@ -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);
}
);
}

Expand Down
2 changes: 1 addition & 1 deletion textpattern/publish/taghandlers.php
Expand Up @@ -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':
Expand Down
2 changes: 1 addition & 1 deletion textpattern/setup/index.php
Expand Up @@ -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') {
Expand Down
6 changes: 3 additions & 3 deletions textpattern/setup/txpsql.php
Expand Up @@ -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'];

Expand All @@ -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)."')");
Expand Down

0 comments on commit 6eff697

Please sign in to comment.