@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | //wggithub_check_db($module); |
35 | 35 | |
36 | 36 | //check upload directory |
37 | - include_once __DIR__ . '/install.php'; |
|
37 | + include_once __DIR__.'/install.php'; |
|
38 | 38 | xoops_module_install_wggithub($module); |
39 | 39 | |
40 | 40 | $errors = $module->getErrors(); |
@@ -59,12 +59,12 @@ discard block |
||
59 | 59 | // update table (add new field) |
60 | 60 | $table = $GLOBALS['xoopsDB']->prefix('wggithub_repositories'); |
61 | 61 | $field = 'repo_release'; |
62 | - $check = $GLOBALS['xoopsDB']->queryF('SHOW COLUMNS FROM `' . $table . "` LIKE '" . $field . "'"); |
|
62 | + $check = $GLOBALS['xoopsDB']->queryF('SHOW COLUMNS FROM `'.$table."` LIKE '".$field."'"); |
|
63 | 63 | $numRows = $GLOBALS['xoopsDB']->getRowsNum($check); |
64 | 64 | if (!$numRows) { |
65 | 65 | $sql = "ALTER TABLE `$table` ADD `$field` INT(1) NOT NULL DEFAULT '0' AFTER `repo_htmlurl`;"; |
66 | 66 | if (!$result = $GLOBALS['xoopsDB']->queryF($sql)) { |
67 | - xoops_error($GLOBALS['xoopsDB']->error() . '<br>' . $sql); |
|
67 | + xoops_error($GLOBALS['xoopsDB']->error().'<br>'.$sql); |
|
68 | 68 | $module->setErrors("Error when adding '$field' to table '$table'."); |
69 | 69 | $ret = false; |
70 | 70 | } |
@@ -73,12 +73,12 @@ discard block |
||
73 | 73 | // update table (add new field) |
74 | 74 | $table = $GLOBALS['xoopsDB']->prefix('wggithub_repositories'); |
75 | 75 | $field = 'repo_prerelease'; |
76 | - $check = $GLOBALS['xoopsDB']->queryF('SHOW COLUMNS FROM `' . $table . "` LIKE '" . $field . "'"); |
|
76 | + $check = $GLOBALS['xoopsDB']->queryF('SHOW COLUMNS FROM `'.$table."` LIKE '".$field."'"); |
|
77 | 77 | $numRows = $GLOBALS['xoopsDB']->getRowsNum($check); |
78 | 78 | if (!$numRows) { |
79 | 79 | $sql = "ALTER TABLE `$table` ADD `$field` INT(1) NOT NULL DEFAULT '0' AFTER `repo_htmlurl`;"; |
80 | 80 | if (!$result = $GLOBALS['xoopsDB']->queryF($sql)) { |
81 | - xoops_error($GLOBALS['xoopsDB']->error() . '<br>' . $sql); |
|
81 | + xoops_error($GLOBALS['xoopsDB']->error().'<br>'.$sql); |
|
82 | 82 | $module->setErrors("Error when adding '$field' to table '$table'."); |
83 | 83 | $ret = false; |
84 | 84 | } |
@@ -86,12 +86,12 @@ discard block |
||
86 | 86 | // update table (add new field) |
87 | 87 | $table = $GLOBALS['xoopsDB']->prefix('wggithub_repositories'); |
88 | 88 | $field = 'repo_readme'; |
89 | - $check = $GLOBALS['xoopsDB']->queryF('SHOW COLUMNS FROM `' . $table . "` LIKE '" . $field . "'"); |
|
89 | + $check = $GLOBALS['xoopsDB']->queryF('SHOW COLUMNS FROM `'.$table."` LIKE '".$field."'"); |
|
90 | 90 | $numRows = $GLOBALS['xoopsDB']->getRowsNum($check); |
91 | 91 | if (!$numRows) { |
92 | 92 | $sql = "ALTER TABLE `$table` ADD `$field` INT(1) NOT NULL DEFAULT '0' AFTER `repo_htmlurl`;"; |
93 | 93 | if (!$result = $GLOBALS['xoopsDB']->queryF($sql)) { |
94 | - xoops_error($GLOBALS['xoopsDB']->error() . '<br>' . $sql); |
|
94 | + xoops_error($GLOBALS['xoopsDB']->error().'<br>'.$sql); |
|
95 | 95 | $module->setErrors("Error when adding '$field' to table '$table'."); |
96 | 96 | $ret = false; |
97 | 97 | } |
@@ -100,12 +100,12 @@ discard block |
||
100 | 100 | // update table (add new field) |
101 | 101 | $table = $GLOBALS['xoopsDB']->prefix('wggithub_directories'); |
102 | 102 | $field = 'dir_filterrelease'; |
103 | - $check = $GLOBALS['xoopsDB']->queryF('SHOW COLUMNS FROM `' . $table . "` LIKE '" . $field . "'"); |
|
103 | + $check = $GLOBALS['xoopsDB']->queryF('SHOW COLUMNS FROM `'.$table."` LIKE '".$field."'"); |
|
104 | 104 | $numRows = $GLOBALS['xoopsDB']->getRowsNum($check); |
105 | 105 | if (!$numRows) { |
106 | 106 | $sql = "ALTER TABLE `$table` ADD `$field` INT(1) NOT NULL DEFAULT '0' AFTER `dir_online`;"; |
107 | 107 | if (!$result = $GLOBALS['xoopsDB']->queryF($sql)) { |
108 | - xoops_error($GLOBALS['xoopsDB']->error() . '<br>' . $sql); |
|
108 | + xoops_error($GLOBALS['xoopsDB']->error().'<br>'.$sql); |
|
109 | 109 | $module->setErrors("Error when adding '$field' to table '$table'."); |
110 | 110 | $ret = false; |
111 | 111 | } |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | PRIMARY KEY (`log_id`) |
128 | 128 | ) ENGINE=InnoDB;"; |
129 | 129 | if (!$result = $GLOBALS['xoopsDB']->queryF($sql)) { |
130 | - xoops_error($GLOBALS['xoopsDB']->error() . '<br>' . $sql); |
|
130 | + xoops_error($GLOBALS['xoopsDB']->error().'<br>'.$sql); |
|
131 | 131 | $module->setErrors("Error when creating table '$table'."); |
132 | 132 | $ret = false; |
133 | 133 | } |
@@ -136,12 +136,12 @@ discard block |
||
136 | 136 | // update table (add new field) |
137 | 137 | $table = $GLOBALS['xoopsDB']->prefix('wggithub_directories'); |
138 | 138 | $field = 'dir_content'; |
139 | - $check = $GLOBALS['xoopsDB']->queryF('SHOW COLUMNS FROM `' . $table . "` LIKE '" . $field . "'"); |
|
139 | + $check = $GLOBALS['xoopsDB']->queryF('SHOW COLUMNS FROM `'.$table."` LIKE '".$field."'"); |
|
140 | 140 | $numRows = $GLOBALS['xoopsDB']->getRowsNum($check); |
141 | 141 | if (!$numRows) { |
142 | 142 | $sql = "ALTER TABLE `$table` ADD `$field` INT(10) NOT NULL DEFAULT '0' AFTER `dir_type`;"; |
143 | 143 | if (!$result = $GLOBALS['xoopsDB']->queryF($sql)) { |
144 | - xoops_error($GLOBALS['xoopsDB']->error() . '<br>' . $sql); |
|
144 | + xoops_error($GLOBALS['xoopsDB']->error().'<br>'.$sql); |
|
145 | 145 | $module->setErrors("Error when adding '$field' to table '$table'."); |
146 | 146 | $ret = false; |
147 | 147 | } |
@@ -150,12 +150,12 @@ discard block |
||
150 | 150 | // update table (add new field) |
151 | 151 | $table = $GLOBALS['xoopsDB']->prefix('wggithub_directories'); |
152 | 152 | $field = 'dir_descr'; |
153 | - $check = $GLOBALS['xoopsDB']->queryF('SHOW COLUMNS FROM `' . $table . "` LIKE '" . $field . "'"); |
|
153 | + $check = $GLOBALS['xoopsDB']->queryF('SHOW COLUMNS FROM `'.$table."` LIKE '".$field."'"); |
|
154 | 154 | $numRows = $GLOBALS['xoopsDB']->getRowsNum($check); |
155 | 155 | if (!$numRows) { |
156 | 156 | $sql = "ALTER TABLE `$table` ADD `$field` TEXT NOT NULL AFTER `dir_type`;"; |
157 | 157 | if (!$result = $GLOBALS['xoopsDB']->queryF($sql)) { |
158 | - xoops_error($GLOBALS['xoopsDB']->error() . '<br>' . $sql); |
|
158 | + xoops_error($GLOBALS['xoopsDB']->error().'<br>'.$sql); |
|
159 | 159 | $module->setErrors("Error when adding '$field' to table '$table'."); |
160 | 160 | $ret = false; |
161 | 161 | } |
@@ -164,12 +164,12 @@ discard block |
||
164 | 164 | // update table (add new field) |
165 | 165 | $table = $GLOBALS['xoopsDB']->prefix('wggithub_readmes'); |
166 | 166 | $field = 'rm_baseurl'; |
167 | - $check = $GLOBALS['xoopsDB']->queryF('SHOW COLUMNS FROM `' . $table . "` LIKE '" . $field . "'"); |
|
167 | + $check = $GLOBALS['xoopsDB']->queryF('SHOW COLUMNS FROM `'.$table."` LIKE '".$field."'"); |
|
168 | 168 | $numRows = $GLOBALS['xoopsDB']->getRowsNum($check); |
169 | 169 | if (!$numRows) { |
170 | 170 | $sql = "ALTER TABLE `$table` ADD `$field` VARCHAR(255) NOT NULL DEFAULT '' AFTER `rm_downloadurl`;"; |
171 | 171 | if (!$result = $GLOBALS['xoopsDB']->queryF($sql)) { |
172 | - xoops_error($GLOBALS['xoopsDB']->error() . '<br>' . $sql); |
|
172 | + xoops_error($GLOBALS['xoopsDB']->error().'<br>'.$sql); |
|
173 | 173 | $module->setErrors("Error when adding '$field' to table '$table'."); |
174 | 174 | $ret = false; |
175 | 175 | } |
@@ -178,12 +178,12 @@ discard block |
||
178 | 178 | // update table (add new field) |
179 | 179 | $table = $GLOBALS['xoopsDB']->prefix('wggithub_directories'); |
180 | 180 | $field = 'dir_weight'; |
181 | - $check = $GLOBALS['xoopsDB']->queryF('SHOW COLUMNS FROM `' . $table . "` LIKE '" . $field . "'"); |
|
181 | + $check = $GLOBALS['xoopsDB']->queryF('SHOW COLUMNS FROM `'.$table."` LIKE '".$field."'"); |
|
182 | 182 | $numRows = $GLOBALS['xoopsDB']->getRowsNum($check); |
183 | 183 | if (!$numRows) { |
184 | 184 | $sql = "ALTER TABLE `$table` ADD `$field` INT(10) NOT NULL DEFAULT '0' AFTER `dir_filterrelease`;"; |
185 | 185 | if (!$result = $GLOBALS['xoopsDB']->queryF($sql)) { |
186 | - xoops_error($GLOBALS['xoopsDB']->error() . '<br>' . $sql); |
|
186 | + xoops_error($GLOBALS['xoopsDB']->error().'<br>'.$sql); |
|
187 | 187 | $module->setErrors("Error when adding '$field' to table '$table'."); |
188 | 188 | $ret = false; |
189 | 189 | } |
@@ -192,12 +192,12 @@ discard block |
||
192 | 192 | // update table (add new field) |
193 | 193 | $table = $GLOBALS['xoopsDB']->prefix('wggithub_repositories'); |
194 | 194 | $field = 'repo_approved'; |
195 | - $check = $GLOBALS['xoopsDB']->queryF('SHOW COLUMNS FROM `' . $table . "` LIKE '" . $field . "'"); |
|
195 | + $check = $GLOBALS['xoopsDB']->queryF('SHOW COLUMNS FROM `'.$table."` LIKE '".$field."'"); |
|
196 | 196 | $numRows = $GLOBALS['xoopsDB']->getRowsNum($check); |
197 | 197 | if (!$numRows) { |
198 | 198 | $sql = "ALTER TABLE `$table` ADD `$field` INT(1) NOT NULL DEFAULT '0' AFTER `repo_release`;"; |
199 | 199 | if (!$result = $GLOBALS['xoopsDB']->queryF($sql)) { |
200 | - xoops_error($GLOBALS['xoopsDB']->error() . '<br>' . $sql); |
|
200 | + xoops_error($GLOBALS['xoopsDB']->error().'<br>'.$sql); |
|
201 | 201 | $module->setErrors("Error when adding '$field' to table '$table'."); |
202 | 202 | $ret = false; |
203 | 203 | } |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | $cat_sql .= current($cats); |
34 | 34 | \array_shift($cats); |
35 | 35 | foreach ($cats as $cat) { |
36 | - $cat_sql .= ',' . $cat; |
|
36 | + $cat_sql .= ','.$cat; |
|
37 | 37 | } |
38 | 38 | } |
39 | 39 | $cat_sql .= ')'; |
@@ -72,9 +72,9 @@ discard block |
||
72 | 72 | { |
73 | 73 | global $xoopsTpl, $xoTheme; |
74 | 74 | $myts = MyTextSanitizer::getInstance(); |
75 | - $content= $myts->undoHtmlSpecialChars($myts->displayTarea($content)); |
|
76 | - if(isset($xoTheme) && \is_object($xoTheme)) { |
|
77 | - $xoTheme->addMeta( 'meta', 'keywords', \strip_tags($content)); |
|
75 | + $content = $myts->undoHtmlSpecialChars($myts->displayTarea($content)); |
|
76 | + if (isset($xoTheme) && \is_object($xoTheme)) { |
|
77 | + $xoTheme->addMeta('meta', 'keywords', \strip_tags($content)); |
|
78 | 78 | } else { // Compatibility for old Xoops versions |
79 | 79 | $xoopsTpl->assign('xoops_meta_keywords', \strip_tags($content)); |
80 | 80 | } |
@@ -91,8 +91,8 @@ discard block |
||
91 | 91 | global $xoopsTpl, $xoTheme; |
92 | 92 | $myts = MyTextSanitizer::getInstance(); |
93 | 93 | $content = $myts->undoHtmlSpecialChars($myts->displayTarea($content)); |
94 | - if(isset($xoTheme) && \is_object($xoTheme)) { |
|
95 | - $xoTheme->addMeta( 'meta', 'description', \strip_tags($content)); |
|
94 | + if (isset($xoTheme) && \is_object($xoTheme)) { |
|
95 | + $xoTheme->addMeta('meta', 'description', \strip_tags($content)); |
|
96 | 96 | } else { // Compatibility for old Xoops versions |
97 | 97 | $xoopsTpl->assign('xoops_meta_description', \strip_tags($content)); |
98 | 98 | } |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | if (0 != $lenght_id) { |
118 | 118 | $id = $array['content_id']; |
119 | 119 | while (\strlen($id) < $lenght_id) { |
120 | - $id = '0' . $id; |
|
120 | + $id = '0'.$id; |
|
121 | 121 | } |
122 | 122 | } else { |
123 | 123 | $id = $array['content_id']; |
@@ -132,23 +132,23 @@ discard block |
||
132 | 132 | switch ($rewrite_url) { |
133 | 133 | |
134 | 134 | case 'none': |
135 | - if($topic_name) { |
|
136 | - $topic_name = 'topic=' . $topic_name . '&'; |
|
135 | + if ($topic_name) { |
|
136 | + $topic_name = 'topic='.$topic_name.'&'; |
|
137 | 137 | } |
138 | 138 | $rewrite_base = '/modules/'; |
139 | - $page = 'page=' . $array['content_alias']; |
|
140 | - return \XOOPS_URL . $rewrite_base . $module . '/' . $type . '.php?' . $topic_name . 'id=' . $id . '&' . $page . $comment; |
|
139 | + $page = 'page='.$array['content_alias']; |
|
140 | + return \XOOPS_URL.$rewrite_base.$module.'/'.$type.'.php?'.$topic_name.'id='.$id.'&'.$page.$comment; |
|
141 | 141 | break; |
142 | 142 | |
143 | 143 | case 'rewrite': |
144 | - if($topic_name) { |
|
144 | + if ($topic_name) { |
|
145 | 145 | $topic_name .= '/'; |
146 | 146 | } |
147 | 147 | $rewrite_base = xoops_getModuleOption('rewrite_mode', $module); |
148 | 148 | $rewrite_ext = xoops_getModuleOption('rewrite_ext', $module); |
149 | 149 | $module_name = ''; |
150 | - if(xoops_getModuleOption('rewrite_name', $module)) { |
|
151 | - $module_name = xoops_getModuleOption('rewrite_name', $module) . '/'; |
|
150 | + if (xoops_getModuleOption('rewrite_name', $module)) { |
|
151 | + $module_name = xoops_getModuleOption('rewrite_name', $module).'/'; |
|
152 | 152 | } |
153 | 153 | $page = $array['content_alias']; |
154 | 154 | $type .= '/'; |
@@ -157,21 +157,21 @@ discard block |
||
157 | 157 | $type = ''; |
158 | 158 | } |
159 | 159 | if ('comment-edit/' === $type || 'comment-reply/' === $type || 'comment-delete/' === $type) { |
160 | - return \XOOPS_URL . $rewrite_base . $module_name . $type . $id . '/'; |
|
160 | + return \XOOPS_URL.$rewrite_base.$module_name.$type.$id.'/'; |
|
161 | 161 | } |
162 | 162 | |
163 | - return \XOOPS_URL . $rewrite_base . $module_name . $type . $topic_name . $id . $page . $rewrite_ext; |
|
163 | + return \XOOPS_URL.$rewrite_base.$module_name.$type.$topic_name.$id.$page.$rewrite_ext; |
|
164 | 164 | break; |
165 | 165 | |
166 | 166 | case 'short': |
167 | - if($topic_name) { |
|
167 | + if ($topic_name) { |
|
168 | 168 | $topic_name .= '/'; |
169 | 169 | } |
170 | 170 | $rewrite_base = xoops_getModuleOption('rewrite_mode', $module); |
171 | 171 | $rewrite_ext = xoops_getModuleOption('rewrite_ext', $module); |
172 | 172 | $module_name = ''; |
173 | - if(xoops_getModuleOption('rewrite_name', $module)) { |
|
174 | - $module_name = xoops_getModuleOption('rewrite_name', $module) . '/'; |
|
173 | + if (xoops_getModuleOption('rewrite_name', $module)) { |
|
174 | + $module_name = xoops_getModuleOption('rewrite_name', $module).'/'; |
|
175 | 175 | } |
176 | 176 | $page = $array['content_alias']; |
177 | 177 | $type .= '/'; |
@@ -179,10 +179,10 @@ discard block |
||
179 | 179 | $type = ''; |
180 | 180 | } |
181 | 181 | if ('comment-edit/' === $type || 'comment-reply/' === $type || 'comment-delete/' === $type) { |
182 | - return \XOOPS_URL . $rewrite_base . $module_name . $type . $id . '/'; |
|
182 | + return \XOOPS_URL.$rewrite_base.$module_name.$type.$id.'/'; |
|
183 | 183 | } |
184 | 184 | |
185 | - return \XOOPS_URL . $rewrite_base . $module_name . $type . $topic_name . $page . $rewrite_ext; |
|
185 | + return \XOOPS_URL.$rewrite_base.$module_name.$type.$topic_name.$page.$rewrite_ext; |
|
186 | 186 | break; |
187 | 187 | } |
188 | 188 | return null; |
@@ -47,15 +47,15 @@ discard block |
||
47 | 47 | $options = [ |
48 | 48 | 'http' => [ |
49 | 49 | 'method' => $request->getMethod(), |
50 | - 'header' => \implode("\r\n", $headerStr) . "\r\n", |
|
51 | - 'follow_location' => 0, # Github sets the Location header for 201 code too and redirection is not required for us |
|
50 | + 'header' => \implode("\r\n", $headerStr)."\r\n", |
|
51 | + 'follow_location' => 0, # Github sets the Location header for 201 code too and redirection is not required for us |
|
52 | 52 | 'protocol_version' => 1.1, |
53 | 53 | 'ignore_errors' => TRUE, |
54 | 54 | ], |
55 | 55 | 'ssl' => [ |
56 | 56 | 'verify_peer' => TRUE, |
57 | - 'cafile' => realpath(__DIR__ . '/../../ca-chain.crt'), |
|
58 | - 'disable_compression' => TRUE, # Effective since PHP 5.4.13 |
|
57 | + 'cafile' => realpath(__DIR__.'/../../ca-chain.crt'), |
|
58 | + 'disable_compression' => TRUE, # Effective since PHP 5.4.13 |
|
59 | 59 | ], |
60 | 60 | ]; |
61 | 61 | |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | $last = ''; |
106 | 106 | foreach ($http_response_header as $header) { |
107 | 107 | if (\in_array(\substr($header, 0, 1), [' ', "\t"], TRUE)) { |
108 | - $headers[$last] .= ' ' . \trim($header); # RFC2616, 2.2 |
|
108 | + $headers[$last] .= ' '.\trim($header); # RFC2616, 2.2 |
|
109 | 109 | } else { |
110 | 110 | list($name, $value) = \explode(':', $header, 2) + [NULL, NULL]; |
111 | 111 | $headers[$last = \trim($name)] = \trim($value); |