From 2f82e69cfb7bf572807884cf7bc5178a2dc2bd49 Mon Sep 17 00:00:00 2001 From: Andrew McMillan Date: Sun, 8 Jul 2012 11:53:21 +1200 Subject: [PATCH] Correctly test for repeated caldav.php in URL. --- htdocs/always.php | 2 +- inc/always.php.in | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/always.php b/htdocs/always.php index c99d36d9..b21a1051 100644 --- a/htdocs/always.php +++ b/htdocs/always.php @@ -315,7 +315,7 @@ function ConstructURL( $partial_path, $force_script = false ) { $url = preg_replace( '#^(https?://.+)//#', '$1/', $url ); // Ensure we don't double any '/' $url = preg_replace('#^https?://[^/]+#', '', $url ); // Remove any protocol + hostname portion - if ( strstr($url, 'caldav.php/caldav.php') ) { + if ( strstr($url, 'caldav.php/caldav.php') !== false ) { trace_bug('Duplicated caldav.php/ in URL "%s" from partial_path=%s, force_script=%s', $url, $partial_path, ($force_script?'true':'false')); $url = str_replace( 'caldav.php/caldav.php', 'caldav.php', $url ); // Ensure we don't double any 'caldav.php/' } diff --git a/inc/always.php.in b/inc/always.php.in index adf2ac1e..cbea3bc5 100644 --- a/inc/always.php.in +++ b/inc/always.php.in @@ -315,7 +315,7 @@ function ConstructURL( $partial_path, $force_script = false ) { $url = preg_replace( '#^(https?://.+)//#', '$1/', $url ); // Ensure we don't double any '/' $url = preg_replace('#^https?://[^/]+#', '', $url ); // Remove any protocol + hostname portion - if ( strstr($url, 'caldav.php/caldav.php') ) { + if ( strstr($url, 'caldav.php/caldav.php') !== false ) { trace_bug('Duplicated caldav.php/ in URL "%s" from partial_path=%s, force_script=%s', $url, $partial_path, ($force_script?'true':'false')); $url = str_replace( 'caldav.php/caldav.php', 'caldav.php', $url ); // Ensure we don't double any 'caldav.php/' }