From 0e1289bdf21665316dd286d4b282c07223e48d63 Mon Sep 17 00:00:00 2001 From: Sam Minnee Date: Wed, 20 Aug 2008 06:31:12 +0000 Subject: [PATCH] Merged branches/kiwiselect into trunk git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@61184 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- core/HTTP.php | 10 +++++++--- core/control/Director.php | 13 ++----------- email/Email.php | 2 +- forms/FormField.php | 2 +- 4 files changed, 11 insertions(+), 16 deletions(-) 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";