eliminate trailing whitespace, expand tabs

This commit is contained in:
Florian Schlichting committed 2016-12-30 08:52:44 +01:00
1 parent 063048802f
commit eb7f2edc0c
50 files changed
+475 -482

No files matched your search

+21 -21
View File
@@ -38,7 +38,7 @@ function early_exception_handler($e) {
foreach( $trace AS $k => $v ) {
printf( "%s[%d] %s%s%s()\n", $v['file'], $v['line'], (isset($v['class'])?$v['class']:''), (isset($v['type'])?$v['type']:''), (isset($v['function'])?$v['function']:'') );
}
}
set_exception_handler('early_exception_handler');
@@ -155,12 +155,12 @@ $c->protocol_server_port = sprintf( '%s://%s%s',
(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on'? 'https' : 'http'),
$_SERVER['SERVER_NAME'],
(
( (!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] != 'on')
&& (!isset($_SERVER['SERVER_PORT']) || $_SERVER['SERVER_PORT'] == 80) )
|| (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on'
&& (!isset($_SERVER['SERVER_PORT']) || $_SERVER['SERVER_PORT'] == 443) )
? ''
: ':'.$_SERVER['SERVER_PORT']
( (!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] != 'on')
&& (!isset($_SERVER['SERVER_PORT']) || $_SERVER['SERVER_PORT'] == 80) )
|| ( isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on'
&& (!isset($_SERVER['SERVER_PORT']) || $_SERVER['SERVER_PORT'] == 443) )
? ''
: ':'.$_SERVER['SERVER_PORT']
) );
$c->protocol_server_port_script = $c->protocol_server_port . ($_SERVER['SCRIPT_NAME'] == '/index.php' ? '' : $_SERVER['SCRIPT_NAME']);
@@ -389,20 +389,20 @@ function ISODateToHTTPDate( $isodate ) {
// It is necessary to use English for this, explicitly. See Debian BTS Bug#661985 for more info.
$month = gmstrftime('%m', strtotime($isodate));
switch( intval($month) ) {
case 1: $month = 'Jan'; break;
case 2: $month = 'Feb'; break;
case 3: $month = 'Mar'; break;
case 4: $month = 'Apr'; break;
case 5: $month = 'May'; break;
case 6: $month = 'Jun'; break;
case 7: $month = 'Jul'; break;
case 8: $month = 'Aug'; break;
case 9: $month = 'Sep'; break;
case 10: $month = 'Oct'; break;
case 11: $month = 'Nov'; break;
case 12: $month = 'Dec'; break;
default:
throw new Exception('Invalid month '.$month);
case 1: $month = 'Jan'; break;
case 2: $month = 'Feb'; break;
case 3: $month = 'Mar'; break;
case 4: $month = 'Apr'; break;
case 5: $month = 'May'; break;
case 6: $month = 'Jun'; break;
case 7: $month = 'Jul'; break;
case 8: $month = 'Aug'; break;
case 9: $month = 'Sep'; break;
case 10: $month = 'Oct'; break;
case 11: $month = 'Nov'; break;
case 12: $month = 'Dec'; break;
default:
throw new Exception('Invalid month '.$month);
}
// Use strtotime since strptime is not available on Windows platform.
return( gmstrftime('%a, %d '.$month.' %Y %H:%M:%S GMT', strtotime($isodate)) );
+2 -2
View File
@@ -22,13 +22,13 @@ elseif ( isset($_SERVER['PATH_INFO']) && $_SERVER['PATH_INFO'] == '/autodiscover
function logRequestHeaders() {
global $c;
/** Log the request headers */
$lines = apache_request_headers();
dbg_error_log( "LOG ", "***************** Request Header ****************" );
dbg_error_log( "LOG ", "%s %s", $_SERVER['REQUEST_METHOD'], $_SERVER['REQUEST_URI'] );
foreach( $lines AS $k => $v ) {
if ( $k != 'Authorization' || (isset($c->dbg['password']) && $c->dbg['password'] ) )
if ( $k != 'Authorization' || (isset($c->dbg['password']) && $c->dbg['password'] ) )
dbg_error_log( "LOG headers", "-->%s: %s", $k, $v );
else
dbg_error_log( "LOG headers", "-->%s: %s", $k, 'Delicious tasty password eaten by debugging monster!' );
+5 -5
View File
@@ -53,7 +53,7 @@ function caldav_get_feed( $request, $collection ) {
if ( $response !== false ) return $response;
$principal = $collection->GetProperty('principal');
/**
* The CalDAV specification does not define GET on a collection, but typically this is
* used as a .ics download for the whole collection, which is what we do also.
@@ -92,9 +92,9 @@ function caldav_get_feed( $request, $collection ) {
$feed->setLink($url);
$feed->setFeedLink($c->protocol_server_port_script . $request->path, 'atom');
$feed->addAuthor(array(
'name' => $principal->GetProperty('displayname'),
'email' => $principal->GetProperty('email'),
'uri' => $c->protocol_server_port . $principal->url(),
'name' => $principal->GetProperty('displayname'),
'email' => $principal->GetProperty('email'),
'uri' => $c->protocol_server_port . $principal->url(),
));
$feed_description = $collection->GetProperty('description');
if ( isset($feed_description) && $feed_description != '' ) $feed->setDescription($feed_description);
@@ -112,7 +112,7 @@ function caldav_get_feed( $request, $collection ) {
$ical = new vComponent( $event->caldav_data );
$event_data = $ical->GetComponents('VTIMEZONE', false);
$item = $feed->createEntry();
$item->setId( $c->protocol_server_port_script . ConstructURL($event->dav_name) );
+1 -1
View File
@@ -106,7 +106,7 @@ function SRVOk ( $value, $name, $row ) {
global $BrowserCurrentRow;
if ( empty($BrowserCurrentRow->domain) ) return ''; // skip empty rows
$s = new iSchedule();
$s->domain = $BrowserCurrentRow->domain;
$s->domain = $BrowserCurrentRow->domain;
return translate( ( $s->getServer()?'OK': SRVFormat ( $s->domain ) ) );
}
+1 -1
View File
@@ -100,7 +100,7 @@ if ( $c->metrics_style != 'counters' ) {
if ( $c->metrics_style != 'memcache' ) {
// These are more basic metrics. Just counts of requests, by type.
$sql = <<<QUERY
SELECT
SELECT
(SELECT last_value FROM metrics_count_get) AS get_count,
(SELECT last_value FROM metrics_count_put) AS put_count,
(SELECT last_value FROM metrics_count_propfind) AS propfind_count,
+12 -12
View File
@@ -9,7 +9,7 @@ function i18n($value) {
$skip_errors = false; // We need to hide a couple of unsightly errors even here...
function log_setup_error($errno , $errstr , $errfile , $errline) {
global $skip_errors;
if ( $skip_errors ) return;
if ( $skip_errors ) return;
error_log('DAViCal setup.php: Informational: '.$errfile.'('.$errline.'): ['.$errno.'] '.$errstr);
}
@@ -51,13 +51,13 @@ class CheckResult {
private $ok;
private $use_class;
private $description;
function __construct( $success, $description=null, $use_class=null ) {
$this->ok = (boolean) $success;
$this->description = (isset($description)?$description : ($success===true? i18n('Passed') : i18n('Fail')));
$this->use_class = (isset($use_class)?$use_class:($success===true?'dep_ok' : 'dep_fail'));
$this->use_class = (isset($use_class)?$use_class:($success===true?'dep_ok' : 'dep_fail'));
}
public function getClass() {
return $this->use_class;
}
@@ -169,7 +169,7 @@ $loaded_extensions = array_flip(get_loaded_extensions());
function do_error( $errormessage ) {
// We can't translate this because we're testing these things even before
// We can't translate this because we're testing these things even before
// the translation interface is available...
printf("<p class='error'><br/>%s</p>", $errormessage );
}
@@ -185,7 +185,7 @@ function get_phpinfo() {
phpinfo();
$phpinfo = ob_get_contents( );
ob_end_clean( );
$phpinfo = preg_replace( '{^.*?<body>}s', '', $phpinfo);
$phpinfo = preg_replace( '{</body>.*?$}s', '', $phpinfo);
return $phpinfo;
@@ -275,16 +275,16 @@ function check_davical_version() {
function check_awl_version() {
global $c;
if ( !function_exists('awl_version') ) return new CheckResult(false);
$result = new CheckResult($c->want_awl_version == awl_version());
if ( ! $result->getOK() ) {
$result->setDescription( sprintf(i18n('Want: %s, Currently: %s'), $c->want_awl_version, awl_version()) );
if ( $c->want_awl_version < awl_version() ) $result->setClass('dep_warning');
}
return $result;
}
@@ -318,7 +318,7 @@ EOTABLE;
function build_dependencies_table( ) {
global $c;
$dependencies = array(
translate('Current DAViCal version ') => 'check_davical_version',
translate('AWL Library version ') => 'check_awl_version',
@@ -343,7 +343,7 @@ function build_dependencies_table( ) {
}
$translated_failure_code = translate('<a href="http://wiki.davical.org/w/Setup_Failure_Codes/%s">Explanation on DAViCal Wiki</a>');
$dependencies_table = '';
$dep_tpl = '<tr class="%s">
<td>%s</td>
@@ -359,7 +359,7 @@ function build_dependencies_table( ) {
rawurlencode($k)
);
}
return $dependencies_table;
}
+1 -1
View File
@@ -78,7 +78,7 @@ class Tools {
$html = '<div id="entryform">';
$html .= '<h1>'.translate('Import all .ics files of a directory') .'</h1>';
$html .= '<p>'.translate('This process will import each file in a directory named "username.ics" and create a user and calendar for each file to import.') .'</p>';
$data = (object) array('directory_path' => '/path/to/your/ics/files','calendar_path' => 'calendar');
$ef = new EntryForm( $_SERVER['REQUEST_URI'],$data , true,true );
$html .= "<table width=\"100%\" class=\"data\">\n";