Skip to content

Commit eb48830

Browse files
committed
feat: model util where empty optimize
1 parent d0ba26b commit eb48830

File tree

5 files changed

+15
-11
lines changed

5 files changed

+15
-11
lines changed

vendor/modstart/modstart/asset/theme/default/style.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/modstart/modstart/resources/asset/src/theme/default/style.less

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ body, html {
5151
}
5252

5353
.table-addition-container {
54-
//padding-bottom: 10px;
54+
padding-bottom: 10px;
5555
}
5656

5757
.table-container {

vendor/modstart/modstart/src/Core/Input/Request.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,11 +114,14 @@ public static function mergeQueries($pair = [])
114114
continue;
115115
}
116116
if (is_array($v)) {
117-
$v = $v[0];
117+
if (!isset($v[0])) {
118+
continue;
119+
}
120+
$v = urlencode($v[0]);
118121
} else {
119122
$v = urlencode($v);
120123
}
121-
$urls[] = "$k=" . $v;
124+
$urls[] = urlencode($k) . '=' . $v;
122125
}
123126

124127
return join('&', $urls);

vendor/modstart/modstart/src/Core/Util/CurlUtil.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -252,8 +252,8 @@ public static function proxyCommon($proxy, $package)
252252

253253
public static function postRaw($url, $param = [], $option = [])
254254
{
255-
if (empty($config['timeout'])) {
256-
$config['timeout'] = 30;
255+
if (empty($option['timeout'])) {
256+
$option['timeout'] = 30;
257257
}
258258
$sendHeaders = [];
259259
if (!empty($option['header'])) {
@@ -268,7 +268,7 @@ public static function postRaw($url, $param = [], $option = [])
268268
curl_setopt($ch, CURLOPT_HTTPHEADER, $sendHeaders);
269269
}
270270
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
271-
curl_setopt($ch, CURLOPT_TIMEOUT, $config['timeout']);
271+
curl_setopt($ch, CURLOPT_TIMEOUT, $option['timeout']);
272272
curl_setopt($ch, CURLOPT_REFERER, $url);
273273
if (defined('CURLOPT_IPRESOLVE') && defined('CURL_IPRESOLVE_V4')) {
274274
curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
@@ -286,8 +286,8 @@ public static function postRaw($url, $param = [], $option = [])
286286

287287
public static function getRaw($url, $param = [], $option = [])
288288
{
289-
if (empty($config['timeout'])) {
290-
$config['timeout'] = 30;
289+
if (empty($option['timeout'])) {
290+
$option['timeout'] = 30;
291291
}
292292
if (!empty($param)) {
293293
$url = $url . '?' . http_build_query($param);
@@ -305,7 +305,7 @@ public static function getRaw($url, $param = [], $option = [])
305305
curl_setopt($ch, CURLOPT_HTTPHEADER, $sendHeaders);
306306
}
307307
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
308-
curl_setopt($ch, CURLOPT_TIMEOUT, $config['timeout']);
308+
curl_setopt($ch, CURLOPT_TIMEOUT, $option['timeout']);
309309
curl_setopt($ch, CURLOPT_REFERER, $url);
310310
if (defined('CURLOPT_IPRESOLVE') && defined('CURL_IPRESOLVE_V4')) {
311311
curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);

vendor/modstart/modstart/src/Core/Util/FileUtil.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,8 @@ public static function savePathToLocalTemp($path, $ext = '')
456456
if (empty($ext)) {
457457
$ext = self::extension($path);
458458
}
459-
$tempPath = public_path('temp/' . md5($path) . (starts_with($ext, '.') ? $ext : '.' . $ext));
459+
$appKey = config('env.APP_KEY');
460+
$tempPath = public_path('temp/' . md5($appKey . ':' . $path) . (starts_with($ext, '.') ? $ext : '.' . $ext));
460461
if (file_exists($tempPath)) {
461462
return $tempPath;
462463
}

0 commit comments

Comments
 (0)