Esempio n. 1
0
 public static function get_url_purpose($proxyable_url_set, $http_method, $url)
 {
     $host = parse_url($url, PHP_URL_HOST);
     $path = rtrim(parse_url($url, PHP_URL_PATH), '/');
     $url_without_protocol = $host . $path;
     UBLogger::debug_var('get_url_purpose $host', $host);
     UBLogger::debug_var('get_url_purpose $path', $path);
     UBLogger::debug_var('get_url_purpose $url_without_protocol', $url_without_protocol);
     if ($http_method == 'GET' && $path == '/_ubhc') {
         return 'HealthCheck';
     } elseif ($http_method == "POST" && preg_match("/^\\/(fsn|fsg|fs)\\/?\$/", $path)) {
         return "SubmitLead";
     } elseif ($http_method == "GET" && UBHTTP::is_tracking_link($proxyable_url_set, $url_without_protocol)) {
         return "TrackClick";
     } elseif (($http_method == "GET" || $http_method == "POST") && (in_array($url_without_protocol, $proxyable_url_set) || UBHTTP::is_confirmation_dialog($proxyable_url_set, $url_without_protocol) || UBHTTP::is_lightbox($proxyable_url_set, $url_without_protocol) || UBHTTP::is_variant($proxyable_url_set, $url_without_protocol))) {
         return "ViewLandingPage";
     } else {
         if ($http_method == "GET" && $path == UBHTTP::$pie_htc_url) {
             // proxy PIE.htc
             return "ViewLandingPage";
         } else {
             return null;
         }
     }
 }