Permalink
Browse files

Add .gitignore, fix http_parse_headers and disabled ssl_verifypeer

  • Loading branch information...
mcls committed Jun 8, 2011
1 parent 04a778e commit 81924c6b835d1fca65ad6fd5090a018b5778958d
Showing with 22 additions and 17 deletions.
  1. +1 −0 .gitignore
  2. +21 −17 gcalendar.class.php
View
@@ -0,0 +1 @@
+test/
View
@@ -670,6 +670,8 @@ private function curlGetHandle($url, $authenticated = false, $headers = array())
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
+
+ curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
return $ch;
}
@@ -701,6 +703,8 @@ private function curlPostHandle($url, $authenticated = false, $headers = array()
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLINFO_HEADER_OUT, true);
+ curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
+
return $ch;
}
@@ -736,6 +740,8 @@ private function curlCustomHandle($url, $method, $authenticated = false, $header
curl_setopt($ch, CURLINFO_HEADER_OUT, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, $follow);
+ curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
+
return $ch;
}
@@ -822,25 +828,23 @@ function addUserToACL($handle = "default", $role = "read", $scope = null, $scope
/**
* Creates the http_parse_headers function if pecl_http is not installed
*/
- if(!function_exists('http_parse_headers')) {
- function http_parse_headers($header) {
- $retVal = array();
- $fields = explode("\r\n", preg_replace('/\x0D\x0A[\x09\x20]+/', ' ', $header));
- foreach( $fields as $field ) {
- if( preg_match('/([^:]+): (.+)/m', $field, $match) ) {
- $match[1] = preg_replace('/(?<=^|[\x09\x20\x2D])./e', 'strtoupper("\0")', strtolower(trim($match[1])));
- if( isset($retVal[$match[1]]) ) {
- $retVal[$match[1]] = array($retVal[$match[1]], $match[2]);
- } else {
- $retVal[$match[1]] = trim($match[2]);
+ function http_parse_headers($header) {
+ if(!function_exists('http_parse_headers')) {
+ $retVal = array();
+ $fields = explode("\r\n", preg_replace('/\x0D\x0A[\x09\x20]+/', ' ', $header));
+ foreach( $fields as $field ) {
+ if( preg_match('/([^:]+): (.+)/m', $field, $match) ) {
+ $match[1] = preg_replace('/(?<=^|[\x09\x20\x2D])./e', 'strtoupper("\0")', strtolower(trim($match[1])));
+ if( isset($retVal[$match[1]]) ) {
+ $retVal[$match[1]] = array($retVal[$match[1]], $match[2]);
+ } else {
+ $retVal[$match[1]] = trim($match[2]);
+ }
}
}
- }
- return $retVal;
- }
- } else {
- function http_parse_headers($header) {
- return http_parse_headers($header);
+ return $retVal;
+ } else {
+ return http_parse_headers($header);
}
}
}

0 comments on commit 81924c6

Please sign in to comment.