diff --git a/synapse/push/__init__.py b/synapse/push/__init__.py
index cc05278c8c9ca5535999b0db8b64342969bccbd6..6a302305fbf498f104bbf95b86c620b08dc1a7a9 100644
--- a/synapse/push/__init__.py
+++ b/synapse/push/__init__.py
@@ -137,6 +137,11 @@ class Pusher(object):
                 return False
             pat = condition['pattern']
 
+            if pat.strip("*?[]") == pat:
+                # no special glob characters so we assume the user means
+                # 'contains this string' rather than 'is this string'
+                pat = "*%s*" % (pat,)
+
             val = _value_for_dotted_key(condition['key'], ev)
             if val is None:
                 return False
diff --git a/synapse/rest/client/v1/push_rule.py b/synapse/rest/client/v1/push_rule.py
index 0f78fa667cd8bb820767e1c49f74262777ea953c..61e3bc82368e3a9cc1c90a943c37219dc1113efb 100644
--- a/synapse/rest/client/v1/push_rule.py
+++ b/synapse/rest/client/v1/push_rule.py
@@ -98,10 +98,7 @@ class PushRuleRestServlet(ClientV1RestServlet):
             if 'pattern' not in req_obj:
                 raise InvalidRuleException("Content rule missing 'pattern'")
             pat = req_obj['pattern']
-            if pat.strip("*?[]") == pat:
-                # no special glob characters so we assume the user means
-                # 'contains this string' rather than 'is this string'
-                pat = "*%s*" % (pat,)
+
             conditions = [{
                 'kind': 'event_match',
                 'key': 'content.body',