fixes report#93: SearchKit shows broken external URLs
authorJon Goldberg <jon@megaphonetech.com>
Sun, 9 Jan 2022 22:48:33 +0000 (17:48 -0500)
committerJon Goldberg <jon@megaphonetech.com>
Sun, 9 Jan 2022 22:48:33 +0000 (17:48 -0500)
ext/search_kit/Civi/Api4/Action/SearchDisplay/AbstractRunAction.php

index 0ed8a5642c8c627ee162aebf35d97a002c72e36d..067545171e8fcb64011143e792768bc3e87cd1b1 100644 (file)
@@ -430,7 +430,7 @@ abstract class AbstractRunAction extends \Civi\Api4\Generic\AbstractAction {
    * @return string
    */
   private function getUrl(string $path, $query = NULL) {
-    if ($path[0] === '/' || strpos($path, 'http://') || strpos($path, 'https://')) {
+    if ($path[0] === '/' || strpos($path, 'http://') !== FALSE || strpos($path, 'https://') !== FALSE) {
       return $path;
     }
     // Use absolute urls when downloading spreadsheet