diff --git a/inc/HTTPClient.php b/inc/HTTPClient.php index 88a86c6bc26e2e4c6b2c5d37a096fe7768d12d0f..e8689bb4d68234c597087cf65ef938ea192793a6 100644 --- a/inc/HTTPClient.php +++ b/inc/HTTPClient.php @@ -297,10 +297,15 @@ class HTTPClient { if($method == 'POST'){ if(is_array($data)){ - if($headers['Content-Type'] == 'multipart/form-data'){ - $headers['Content-Type'] = 'multipart/form-data; boundary='.$this->boundary; + if (empty($headers['Content-Type'])) { + $headers['Content-Type'] = null; + } + switch ($headers['Content-Type']) { + case 'multipart/form-data': + $headers['Content-Type'] = 'multipart/form-data; boundary=' . $this->boundary; $data = $this->_postMultipartEncode($data); - }else{ + break; + default: $headers['Content-Type'] = 'application/x-www-form-urlencoded'; $data = $this->_postEncode($data); } diff --git a/inc/confutils.php b/inc/confutils.php index fb9a3edd7a5b66cdb70cbcf82f8dc6e474258249..836b3829203217d1287299ca58a316acf527bae9 100644 --- a/inc/confutils.php +++ b/inc/confutils.php @@ -221,6 +221,9 @@ function linesToHash($lines, $lower=false) { if(empty($line)) continue; $line = preg_split('/\s+/',$line,2); // Build the associative array + if (empty($line[1])) { + $line[1] = ''; + } if($lower){ $conf[strtolower($line[0])] = $line[1]; }else{ diff --git a/inc/html.php b/inc/html.php index e7bc072e66b64dd4a60e16226de231fb83125e26..120d72b1f1bd06a2265c1bdce22dbf6b10b0fb45 100644 --- a/inc/html.php +++ b/inc/html.php @@ -1046,7 +1046,8 @@ function html_buildlist($data,$class,$func,$lifunc='html_li_default',$forcewrapp return ''; } - $start_level = $data[0]['level']; + $firstElement = reset($data); + $start_level = $firstElement['level']; $level = $start_level; $ret = ''; $open = 0; diff --git a/inc/parser/renderer.php b/inc/parser/renderer.php index 13deac29c98f0f581d445a108585b88c110d3b2d..83b51d4b13ffbd12c85220bd0016f20066410adf 100644 --- a/inc/parser/renderer.php +++ b/inc/parser/renderer.php @@ -863,7 +863,11 @@ class Doku_Renderer extends DokuWiki_Plugin { } //handle as wiki links if($url{0} === ':') { - list($id, $urlparam) = explode('?', $url, 2); + $urlparam = null; + $id = $url; + if (strpos($url, '?') !== false) { + list($id, $urlparam) = explode('?', $url, 2); + } $url = wl(cleanID($id), $urlparam); $exists = page_exists($id); } diff --git a/lib/plugins/extension/helper/extension.php b/lib/plugins/extension/helper/extension.php index 339cc1bc65f1d6256195cba42f7d8c4228a60cd1..e77528b97f4d0a974d97a982868f8d96a18d9a31 100644 --- a/lib/plugins/extension/helper/extension.php +++ b/lib/plugins/extension/helper/extension.php @@ -340,7 +340,7 @@ class helper_plugin_extension_extension extends DokuWiki_Plugin { * @return array The names of the conflicting extensions */ public function getConflicts() { - if (!empty($this->remoteInfo['conflicts'])) return $this->remoteInfo['dependencies']; + if (!empty($this->remoteInfo['conflicts'])) return $this->remoteInfo['conflicts']; return array(); } diff --git a/lib/plugins/extension/helper/list.php b/lib/plugins/extension/helper/list.php index 6ca72f7cef90438a2720589fa417a09c4e1df790..656b4ea09154871f8e271d8c7a78d5eb24f03eeb 100644 --- a/lib/plugins/extension/helper/list.php +++ b/lib/plugins/extension/helper/list.php @@ -340,9 +340,9 @@ class helper_plugin_extension_list extends DokuWiki_Plugin { $link = parse_url($url); $base = $link['host']; - if($link['port']) $base .= $base.':'.$link['port']; + if(!empty($link['port'])) $base .= $base.':'.$link['port']; $long = $link['path']; - if($link['query']) $long .= $link['query']; + if(!empty($link['query'])) $long .= $link['query']; $name = shorten($base, $long, 55);