mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Merged branches/kiwiselect into trunk
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@61184 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
7912aa3b4a
commit
0e1289bdf2
@ -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);
|
||||
|
||||
if($getResponse){
|
||||
$response = stream_get_contents($socket);
|
||||
return $response;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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</$tag>";
|
||||
|
Loading…
Reference in New Issue
Block a user