diff --git a/core/HTTP.php b/core/HTTP.php index 6d821a71a..78110830a 100644 --- a/core/HTTP.php +++ b/core/HTTP.php @@ -236,7 +236,7 @@ class HTTP { * @param string $port * @return string Raw HTTP-result including headers */ - static function sendPostRequest($host, $path, $data, $name = null, $query = '', $port = 80) { + static function sendPostRequest($host, $path, $data, $name = null, $query = '', $port = 80, $getResponse = true) { $socket = fsockopen($host, $port, $errno, $error); if(!$socket) @@ -244,6 +244,8 @@ class HTTP { if(self::$userName && self::$password) $auth = "Authorization: Basic " . base64_encode(self::$userName . ':' . self::$password) . "\r\n"; + else + $auth = ''; if($query) $query = '?' . $query; @@ -253,9 +255,11 @@ class HTTP { $request .= $dataStr . "\r\n\r\n"; fwrite($socket, $request); - $response = stream_get_contents($socket); - return $response; + if($getResponse){ + $response = stream_get_contents($socket); + return $response; + } } diff --git a/core/control/Director.php b/core/control/Director.php index d5f91e7da..80caf908d 100644 --- a/core/control/Director.php +++ b/core/control/Director.php @@ -437,16 +437,7 @@ class Director { } /** - * Given a filesystem reference relative to the site root, return the full filesystem path - */ - /** - * Cleans up a given file-path - * - * @param string $file - * @return string - */ - /** - * Cleans up a given file-path + * Given a filesystem reference relative to the site root, return the full file-system path. * * @param string $file * @return string @@ -660,7 +651,7 @@ class Director { // Use ?isDev=1 to get development access on the live server if(isset($_GET['isDev'])) { if(ClassInfo::ready()) { - BasicAuth::requireLogin("SilverStripe developer access. Use your CMS login", "ADMIN"); + BasicAuth::requireLogin("SilverStripe developer access. Use your CMS login", "ADMIN"); $_SESSION['isDev'] = $_GET['isDev']; } else { return true; diff --git a/email/Email.php b/email/Email.php index 19a7725b1..1abf2d278 100755 --- a/email/Email.php +++ b/email/Email.php @@ -332,7 +332,7 @@ class Email extends ViewableData { if(!empty($headers['Bcc']) && trim($headers['Bcc'])) { $headers['Bcc'] .= ', ' . self::$bcc_all_emails_to; } else { - $headers['Cc'] = self::$bcc_all_emails_to; + $headers['Bcc'] = self::$bcc_all_emails_to; } } diff --git a/forms/FormField.php b/forms/FormField.php index cc0f4fb9f..ce104a0b4 100644 --- a/forms/FormField.php +++ b/forms/FormField.php @@ -441,7 +441,7 @@ HTML; function createTag($tag, $attributes, $content = null) { $preparedAttributes = ''; foreach($attributes as $k => $v) { - if(!empty($v)) $preparedAttributes .= " $k=\"" . Convert::raw2att($v) . "\""; + if(!empty($v) || $v === '0') $preparedAttributes .= " $k=\"" . Convert::raw2att($v) . "\""; } if($content) return "<$tag$preparedAttributes>$content";