summaryrefslogtreecommitdiffstats
path: root/inc
diff options
context:
space:
mode:
authorSimon Rettberg2015-09-11 17:11:33 +0200
committerSimon Rettberg2015-09-11 17:11:33 +0200
commit3fd230bb501337153771098083e1379875d98235 (patch)
tree15f9338b6bb235b7be7232ca8e011c5fdb92a82b /inc
parentAdd org list to dozmod module (diff)
downloadslx-admin-3fd230bb501337153771098083e1379875d98235.tar.gz
slx-admin-3fd230bb501337153771098083e1379875d98235.tar.xz
slx-admin-3fd230bb501337153771098083e1379875d98235.zip
Image delete feature
Diffstat (limited to 'inc')
-rw-r--r--inc/download.inc.php12
-rw-r--r--inc/message.inc.php2
2 files changed, 8 insertions, 6 deletions
diff --git a/inc/download.inc.php b/inc/download.inc.php
index 5347e2ee..51601545 100644
--- a/inc/download.inc.php
+++ b/inc/download.inc.php
@@ -69,11 +69,13 @@ class Download
public static function asStringPost($url, $params, $timeout, &$code)
{
$string = '';
- foreach ($params as $k => $v) {
- if (!empty($string)) {
- $string .= '&';
+ if (is_array($params)) {
+ foreach ($params as $k => $v) {
+ if (!empty($string)) {
+ $string .= '&';
+ }
+ $string .= $k . '=' . urlencode($v);
}
- $string .= $k . '=' . urlencode($v);
}
$ch = self::initCurl($url, $timeout, $head);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
@@ -115,7 +117,7 @@ class Download
return false;
}
if (preg_match_all('#\bHTTP/\d+\.\d+ (\d+) #', $head, $out, PREG_SET_ORDER)) {
- $code = (int) $out[count($out)-1][1];
+ $code = (int) $out[count($out) - 1][1];
} else {
$code = '999 ' . curl_error($ch);
}
diff --git a/inc/message.inc.php b/inc/message.inc.php
index 2fccb0a0..472811ff 100644
--- a/inc/message.inc.php
+++ b/inc/message.inc.php
@@ -120,7 +120,7 @@ class Message
foreach (array_merge(self::$list, self::$alreadyDisplayed) as $item) {
$str = 'message[]=' . urlencode($item['type'] . '|' .$item['id']);
if (!empty($item['params'])) {
- $str .= '|' . implode('|', $item['params']);
+ $str .= '|' . urlencode(implode('|', $item['params']));
}
$parts[] = $str;
}