Passed
Push — master ( 492cc7...e5a5fc )
by Michael
45s queued 11s
created
include/config.php 1 patch
Indentation   +72 added lines, -72 removed lines patch added patch discarded remove patch
@@ -33,83 +33,83 @@
 block discarded – undo
33 33
  */
34 34
 function getConfig()
35 35
 {
36
-    $moduleDirName      = basename(dirname(__DIR__));
37
-    $moduleDirNameUpper = strtoupper($moduleDirName);
38
-    return (object)[
39
-        'name'           => strtoupper($moduleDirName) . ' Module Configurator',
40
-        'paths'          => [
41
-            'dirname'    => $moduleDirName,
42
-            'admin'      => XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . '/admin',
43
-            'modPath'    => XOOPS_ROOT_PATH . '/modules/' . $moduleDirName,
44
-            'modUrl'     => XOOPS_URL . '/modules/' . $moduleDirName,
45
-            'uploadPath' => XOOPS_UPLOAD_PATH . '/' . $moduleDirName,
46
-            'uploadUrl'  => XOOPS_UPLOAD_URL . '/' . $moduleDirName,
47
-        ],
48
-        'uploadFolders'  => [
49
-            constant($moduleDirNameUpper . '_UPLOAD_PATH'),
50
-            constant($moduleDirNameUpper . '_UPLOAD_PATH') . '/thumbs',
36
+	$moduleDirName      = basename(dirname(__DIR__));
37
+	$moduleDirNameUpper = strtoupper($moduleDirName);
38
+	return (object)[
39
+		'name'           => strtoupper($moduleDirName) . ' Module Configurator',
40
+		'paths'          => [
41
+			'dirname'    => $moduleDirName,
42
+			'admin'      => XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . '/admin',
43
+			'modPath'    => XOOPS_ROOT_PATH . '/modules/' . $moduleDirName,
44
+			'modUrl'     => XOOPS_URL . '/modules/' . $moduleDirName,
45
+			'uploadPath' => XOOPS_UPLOAD_PATH . '/' . $moduleDirName,
46
+			'uploadUrl'  => XOOPS_UPLOAD_URL . '/' . $moduleDirName,
47
+		],
48
+		'uploadFolders'  => [
49
+			constant($moduleDirNameUpper . '_UPLOAD_PATH'),
50
+			constant($moduleDirNameUpper . '_UPLOAD_PATH') . '/thumbs',
51 51
 
52
-            //XOOPS_UPLOAD_PATH . '/flags'
53
-        ],
54
-        'copyBlankFiles' => [
55
-            constant($moduleDirNameUpper . '_UPLOAD_PATH'),
56
-            constant($moduleDirNameUpper . '_UPLOAD_PATH') . '/thumbs',
57
-            //XOOPS_UPLOAD_PATH . '/flags'
58
-        ],
52
+			//XOOPS_UPLOAD_PATH . '/flags'
53
+		],
54
+		'copyBlankFiles' => [
55
+			constant($moduleDirNameUpper . '_UPLOAD_PATH'),
56
+			constant($moduleDirNameUpper . '_UPLOAD_PATH') . '/thumbs',
57
+			//XOOPS_UPLOAD_PATH . '/flags'
58
+		],
59 59
 
60
-        'copyTestFolders' => [
61
-            //        constant($moduleDirNameUpper . '_UPLOAD_PATH'),
62
-            //[
63
-            //    constant($moduleDirNameUpper . '_PATH') . '/testdata/images',
64
-            //    constant($moduleDirNameUpper . '_UPLOAD_PATH') . '/images',
65
-            //]
66
-        ],
60
+		'copyTestFolders' => [
61
+			//        constant($moduleDirNameUpper . '_UPLOAD_PATH'),
62
+			//[
63
+			//    constant($moduleDirNameUpper . '_PATH') . '/testdata/images',
64
+			//    constant($moduleDirNameUpper . '_UPLOAD_PATH') . '/images',
65
+			//]
66
+		],
67 67
 
68
-        'templateFolders' => [
69
-            '/templates/',
70
-            '/templates/blocks/',
71
-            '/templates/admin/'
68
+		'templateFolders' => [
69
+			'/templates/',
70
+			'/templates/blocks/',
71
+			'/templates/admin/'
72 72
 
73
-        ],
74
-        'oldFiles'        => [
75
-            '/class/request.php',
76
-            '/class/registry.php',
77
-            '/class/utilities.php',
78
-            '/class/util.php',
79
-            // '/include/constants.php',
80
-            // '/include/functions.php',
81
-            '/ajaxrating.txt',
82
-        ],
83
-        'oldFolders'      => [
84
-            '/images',
85
-            '/css',
86
-            '/js',
87
-            '/tcpdf',
88
-            '/images',
89
-        ],
73
+		],
74
+		'oldFiles'        => [
75
+			'/class/request.php',
76
+			'/class/registry.php',
77
+			'/class/utilities.php',
78
+			'/class/util.php',
79
+			// '/include/constants.php',
80
+			// '/include/functions.php',
81
+			'/ajaxrating.txt',
82
+		],
83
+		'oldFolders'      => [
84
+			'/images',
85
+			'/css',
86
+			'/js',
87
+			'/tcpdf',
88
+			'/images',
89
+		],
90 90
 
91
-        'renameTables' => [
92
-            'bb_archive'     => 'newbb_archive',
93
-            'bb_categories'  => 'newbb_categories',
94
-            'bb_votedata'    => 'newbb_votedata',
95
-            'bb_forums'      => 'newbb_forums',
96
-            'bb_posts'       => 'newbb_posts',
97
-            'bb_posts_text'  => 'newbb_posts_text',
98
-            'bb_topics'      => 'newbb_topics',
99
-            'bb_online'      => 'newbb_online',
100
-            'bb_digest'      => 'newbb_digest',
101
-            'bb_report'      => 'newbb_report',
102
-            'bb_attachments' => 'newbb_attachments',
103
-            'bb_moderates'   => 'newbb_moderates',
104
-            'bb_reads_forum' => 'newbb_reads_forum',
105
-            'bb_reads_topic' => 'newbb_reads_topic',
106
-            'bb_type'        => 'newbb_type',
107
-            'bb_type_forum'  => 'newbb_type_forum',
108
-            'bb_stats'       => 'newbb_stats',
109
-            'bb_user_stats'  => 'newbb_user_stats',
110
-        ],
91
+		'renameTables' => [
92
+			'bb_archive'     => 'newbb_archive',
93
+			'bb_categories'  => 'newbb_categories',
94
+			'bb_votedata'    => 'newbb_votedata',
95
+			'bb_forums'      => 'newbb_forums',
96
+			'bb_posts'       => 'newbb_posts',
97
+			'bb_posts_text'  => 'newbb_posts_text',
98
+			'bb_topics'      => 'newbb_topics',
99
+			'bb_online'      => 'newbb_online',
100
+			'bb_digest'      => 'newbb_digest',
101
+			'bb_report'      => 'newbb_report',
102
+			'bb_attachments' => 'newbb_attachments',
103
+			'bb_moderates'   => 'newbb_moderates',
104
+			'bb_reads_forum' => 'newbb_reads_forum',
105
+			'bb_reads_topic' => 'newbb_reads_topic',
106
+			'bb_type'        => 'newbb_type',
107
+			'bb_type_forum'  => 'newbb_type_forum',
108
+			'bb_stats'       => 'newbb_stats',
109
+			'bb_user_stats'  => 'newbb_user_stats',
110
+		],
111 111
 
112
-        'modCopyright' => "<a href='https://xoops.org' title='XOOPS Project' target='_blank'>
112
+		'modCopyright' => "<a href='https://xoops.org' title='XOOPS Project' target='_blank'>
113 113
                      <img src='" . constant($moduleDirNameUpper . '_AUTHOR_LOGOIMG') . '\' alt=\'XOOPS Project\' /></a>',
114
-    ];
114
+	];
115 115
 }
Please login to merge, or discard this patch.
admin/index.php 1 patch
Indentation   +61 added lines, -61 removed lines patch added patch discarded remove patch
@@ -49,10 +49,10 @@  discard block
 block discarded – undo
49 49
  */
50 50
 function newbb_admin_mkdir($target, $mode = 0777)
51 51
 {
52
-    $target = str_replace('..', '', $target);
52
+	$target = str_replace('..', '', $target);
53 53
 
54
-    // http://www.php.net/manual/en/function.mkdir.php
55
-    return is_dir($target) || (newbb_admin_mkdir(dirname($target), $mode) && (!mkdir($target, $mode) && !is_dir($target)));
54
+	// http://www.php.net/manual/en/function.mkdir.php
55
+	return is_dir($target) || (newbb_admin_mkdir(dirname($target), $mode) && (!mkdir($target, $mode) && !is_dir($target)));
56 56
 }
57 57
 
58 58
 /**
@@ -62,9 +62,9 @@  discard block
 block discarded – undo
62 62
  */
63 63
 function newbb_admin_chmod($target, $mode = 0777)
64 64
 {
65
-    $target = str_replace('..', '', $target);
65
+	$target = str_replace('..', '', $target);
66 66
 
67
-    return @chmod($target, $mode);
67
+	return @chmod($target, $mode);
68 68
 }
69 69
 
70 70
 /**
@@ -72,32 +72,32 @@  discard block
 block discarded – undo
72 72
  */
73 73
 function newbb_getImageLibs()
74 74
 {
75
-    $imageLibs = [];
76
-    unset($output, $status);
77
-    if (1 == $GLOBALS['xoopsModuleConfig']['image_lib'] || 0 == $GLOBALS['xoopsModuleConfig']['image_lib']) {
78
-        $path = empty($GLOBALS['xoopsModuleConfig']['path_magick']) ? '' : $GLOBALS['xoopsModuleConfig']['path_magick'] . '/';
79
-        @exec($path . 'convert -version', $output, $status);
80
-        if (empty($status) && !empty($output) && preg_match("/imagemagick[ \t]+([0-9\.]+)/i", $output[0], $matches)) {
81
-            $imageLibs['imagemagick'] = $matches[0];
82
-        }
83
-
84
-        unset($output, $status);
85
-    }
86
-    if (2 == $GLOBALS['xoopsModuleConfig']['image_lib'] || 0 == $GLOBALS['xoopsModuleConfig']['image_lib']) {
87
-        $path = empty($GLOBALS['xoopsModuleConfig']['path_netpbm']) ? '' : $GLOBALS['xoopsModuleConfig']['path_netpbm'] . '/';
88
-        @exec($path . 'jpegtopnm -version 2>&1', $output, $status);
89
-        if (empty($status) && !empty($output) && preg_match("/netpbm[ \t]+([0-9\.]+)/i", $output[0], $matches)) {
90
-            $imageLibs['netpbm'] = $matches[0];
91
-        }
92
-        unset($output, $status);
93
-    }
94
-
95
-    if (function_exists('gd_info')) {
96
-        $tmpInfo         = gd_info();
97
-        $imageLibs['gd'] = $tmpInfo['GD Version'];
98
-    }
99
-
100
-    return $imageLibs;
75
+	$imageLibs = [];
76
+	unset($output, $status);
77
+	if (1 == $GLOBALS['xoopsModuleConfig']['image_lib'] || 0 == $GLOBALS['xoopsModuleConfig']['image_lib']) {
78
+		$path = empty($GLOBALS['xoopsModuleConfig']['path_magick']) ? '' : $GLOBALS['xoopsModuleConfig']['path_magick'] . '/';
79
+		@exec($path . 'convert -version', $output, $status);
80
+		if (empty($status) && !empty($output) && preg_match("/imagemagick[ \t]+([0-9\.]+)/i", $output[0], $matches)) {
81
+			$imageLibs['imagemagick'] = $matches[0];
82
+		}
83
+
84
+		unset($output, $status);
85
+	}
86
+	if (2 == $GLOBALS['xoopsModuleConfig']['image_lib'] || 0 == $GLOBALS['xoopsModuleConfig']['image_lib']) {
87
+		$path = empty($GLOBALS['xoopsModuleConfig']['path_netpbm']) ? '' : $GLOBALS['xoopsModuleConfig']['path_netpbm'] . '/';
88
+		@exec($path . 'jpegtopnm -version 2>&1', $output, $status);
89
+		if (empty($status) && !empty($output) && preg_match("/netpbm[ \t]+([0-9\.]+)/i", $output[0], $matches)) {
90
+			$imageLibs['netpbm'] = $matches[0];
91
+		}
92
+		unset($output, $status);
93
+	}
94
+
95
+	if (function_exists('gd_info')) {
96
+		$tmpInfo         = gd_info();
97
+		$imageLibs['gd'] = $tmpInfo['GD Version'];
98
+	}
99
+
100
+	return $imageLibs;
101 101
 }
102 102
 
103 103
 xoops_cp_header();
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
 //XOOPS_POLL
114 114
 $xoopspoll = $moduleHandler->getByDirname($GLOBALS['xoopsModuleConfig']['poll_module']);
115 115
 if (is_object($xoopspoll)) {
116
-    $isOK = $xoopspoll->getVar('isactive');
116
+	$isOK = $xoopspoll->getVar('isactive');
117 117
 }
118 118
 // END irmtfan add a poll_module config
119 119
 
@@ -121,19 +121,19 @@  discard block
 block discarded – undo
121 121
 $postmaxsize_iniphp = return_bytes(@ini_get('post_max_size'));
122 122
 $uploadlimit        = _AM_NEWBB_MEMLIMITTOLARGE;
123 123
 if ($postmaxsize_iniphp < $memlimit_iniphp) {
124
-    $uploadlimit = sprintf(_AM_NEWBB_MEMLIMITOK, return_bytes($postmaxsize_iniphp, true));
124
+	$uploadlimit = sprintf(_AM_NEWBB_MEMLIMITOK, return_bytes($postmaxsize_iniphp, true));
125 125
 }
126 126
 
127 127
 $adminObject->addInfoBox(_AM_NEWBB_PREFERENCES);
128 128
 // START irmtfan better poll module display link and version - check if xoops poll module is available
129 129
 if ($isOK) {
130
-    $pollLink = _AM_NEWBB_AVAILABLE . ': ';
131
-    $pollLink .= '<a href="' . XOOPS_URL . '/modules/' . $xoopspoll->getVar('dirname') . '/admin/index.php"';
132
-    $pollLink .= ' alt="' . $xoopspoll->getVar('name') . ' ' . _VERSION . ' (' . $xoopspoll->getInfo('version') . ') "';
133
-    $pollLink .= ' title="' . $xoopspoll->getVar('name') . ' ' . _VERSION . ' (' . $xoopspoll->getInfo('version') . ') "';
134
-    $pollLink .= '>' . '(' . $xoopspoll->getVar('name') . ')</a>';
130
+	$pollLink = _AM_NEWBB_AVAILABLE . ': ';
131
+	$pollLink .= '<a href="' . XOOPS_URL . '/modules/' . $xoopspoll->getVar('dirname') . '/admin/index.php"';
132
+	$pollLink .= ' alt="' . $xoopspoll->getVar('name') . ' ' . _VERSION . ' (' . $xoopspoll->getInfo('version') . ') "';
133
+	$pollLink .= ' title="' . $xoopspoll->getVar('name') . ' ' . _VERSION . ' (' . $xoopspoll->getInfo('version') . ') "';
134
+	$pollLink .= '>' . '(' . $xoopspoll->getVar('name') . ')</a>';
135 135
 } else {
136
-    $pollLink = _AM_NEWBB_NOTAVAILABLE;
136
+	$pollLink = _AM_NEWBB_NOTAVAILABLE;
137 137
 }
138 138
 $adminObject->addInfoBoxLine(sprintf(_AM_NEWBB_POLLMODULE . ': %s', $pollLink));
139 139
 // END irmtfan better poll module display link and version - check if xoops poll module is available
@@ -154,8 +154,8 @@  discard block
 block discarded – undo
154 154
 
155 155
 $_ufolders = $newbb_config->uploadFolders;
156 156
 foreach ($_ufolders as $wert) { 
157
-    Newbb\Utility::prepareFolder($wert);
158
-    $adminObject->addConfigBoxLine($wert, 'folder');
157
+	Newbb\Utility::prepareFolder($wert);
158
+	$adminObject->addConfigBoxLine($wert, 'folder');
159 159
 }
160 160
 
161 161
 
@@ -176,24 +176,24 @@  discard block
 block discarded – undo
176 176
  */
177 177
 function return_bytes($sizeAsString, $b = false)
178 178
 {
179
-    if (false === $b) {
180
-        switch (substr($sizeAsString, -1)) {
181
-            case 'M':
182
-            case 'm':
183
-                return (int)$sizeAsString * 1048576;
184
-            case 'K':
185
-            case 'k':
186
-                return (int)$sizeAsString * 1024;
187
-            case 'G':
188
-            case 'g':
189
-                return (int)$sizeAsString * 1073741824;
190
-            default:
191
-                return $sizeAsString;
192
-        }
193
-    } else {
194
-        $base   = log($sizeAsString) / log(1024);
195
-        $suffix = ['', 'KB', 'MB', 'GB', 'TB'];
196
-
197
-        return round(1024 ** ($base - floor($base))) . ' ' . $suffix[(int)floor($base)];
198
-    }
179
+	if (false === $b) {
180
+		switch (substr($sizeAsString, -1)) {
181
+			case 'M':
182
+			case 'm':
183
+				return (int)$sizeAsString * 1048576;
184
+			case 'K':
185
+			case 'k':
186
+				return (int)$sizeAsString * 1024;
187
+			case 'G':
188
+			case 'g':
189
+				return (int)$sizeAsString * 1073741824;
190
+			default:
191
+				return $sizeAsString;
192
+		}
193
+	} else {
194
+		$base   = log($sizeAsString) / log(1024);
195
+		$suffix = ['', 'KB', 'MB', 'GB', 'TB'];
196
+
197
+		return round(1024 ** ($base - floor($base))) . ' ' . $suffix[(int)floor($base)];
198
+	}
199 199
 }
Please login to merge, or discard this patch.