Add slashes to member list in city settings view
authorLaury GvR <laury@gaslightmedia.com>
Wed, 6 Mar 2019 19:13:09 +0000 (14:13 -0500)
committerLaury GvR <laury@gaslightmedia.com>
Wed, 6 Mar 2019 19:13:09 +0000 (14:13 -0500)
When viewing the members that have a given city assigned in the
'cities' settings page, the list breaks when a member has quotes
in its name. This has now been fixed.

models/admin/settings/cities.php

index 6eb26e8..374f8bc 100644 (file)
@@ -185,7 +185,7 @@ class GlmMembersAdmin_settings_cities extends GlmDataCities
         }
         // $citiesWithMembersJSON = htmlspecialchars(json_encode($citiesWithMembers), ENT_QUOTES, 'UTF-8');
         $citiesWithMembersJSON = json_encode( $citiesWithMembers );
-        $citiesWithMembersJSON = str_replace( "'", "\'", $citiesWithMembersJSON );
+        $citiesWithMembersJSON = addSlashes( $citiesWithMembersJSON );
 
 
         // Compile template data