Skip to main content
Version: Fegg 5.x

Embed::isMapEmbed

Check whether a URL is a Google Maps embed URL

Description​

public static bool Embed::isMapEmbed( string $src )

Returns true when $src is the URL of Google Maps' "Embed a map" (https://www.google.com/maps/embed?pb=...). Fegg\Cms\HtmlSanitizer keeps the iframes of the editor's text whose src this method (or Embed::isYoutubeEmbed) accepts.

Arguments​

NameData typeDefaultRemarks
$srcstringURL to check

Example​

Controller
use Fegg\Tool\Embed;

Embed::isMapEmbed('https://www.google.com/maps/embed?pb=!1m18!1m12'); // -> true
Embed::isMapEmbed('https://maps.google.com/?q=Tokyo'); // -> false