Automattic/jetpack — pull request #945 by iandunn (2014-08-06 04:09:08+00:00)
Title: Shortcodes: Fix [googlemaps] shortcode reversal false positive.

`jetpack_googlemaps_embed_to_short_code()` is intended to only reverse URLs in
the format of `https://maps.google.com` or `https://google.com/maps/`, but it
is matching any `google.com` domain.

For example, the following tag will be reversed into a `[googlemaps]` shortcode
even though it should not be:

```HTML

```

The problem is that the code mistakeningly tests for a `false` return from
`preg_match()` instead of `0` or `false`. Unlike `strpos()`, `preg_match()`
returns `0` if the pattern is not matched, and `false` if there is an error.
Because of this, the condition evaluates to true, and the function
doesn't returns early.

This bug was introduced in 7d5c5a77b25474798554fba4e8f72c853f96b507.