Loading src/Plugin/views/argument/GeofieldProximityArgument.php +10 −17 Original line number Diff line number Diff line Loading @@ -205,14 +205,10 @@ class GeofieldProximityArgument extends Formula implements ContainerFactoryPlugi * The calculated values. */ public function getParsedReferenceLocation() { // Cache the vales so this only gets processed once. static $values; if (!isset($values)) { // Process argument values into an array. preg_match('/^([0-9\-.]+),+([0-9\-.]+)([<>=]+)([0-9.]+)(.*$)/', trim($this->getValue()), $values); // Validate and return the passed argument. $values = is_array($values) && !empty($values) ? [ return is_array($values) && !empty($values) ? [ 'lat' => (isset($values[1]) && is_numeric($values[1]) && $values[1] >= -90 && $values[1] <= 90) ? floatval($values[1]) : FALSE, 'lon' => (isset($values[2]) && is_numeric($values[2]) && $values[2] >= -180 && $values[2] <= 180) ? floatval($values[2]) : FALSE, 'operator' => (isset($values[3]) && in_array($values[3], [ Loading @@ -226,9 +222,6 @@ class GeofieldProximityArgument extends Formula implements ContainerFactoryPlugi 'distance' => (isset($values[4])) ? floatval($values[4]) : FALSE, 'units' => (isset($values[5]) && array_key_exists($values[5], $this->units)) ? $this->units[$values[5]]['value'] : 'GEOFIELD_KILOMETERS', ] : FALSE; } return $values; } } Loading
src/Plugin/views/argument/GeofieldProximityArgument.php +10 −17 Original line number Diff line number Diff line Loading @@ -205,14 +205,10 @@ class GeofieldProximityArgument extends Formula implements ContainerFactoryPlugi * The calculated values. */ public function getParsedReferenceLocation() { // Cache the vales so this only gets processed once. static $values; if (!isset($values)) { // Process argument values into an array. preg_match('/^([0-9\-.]+),+([0-9\-.]+)([<>=]+)([0-9.]+)(.*$)/', trim($this->getValue()), $values); // Validate and return the passed argument. $values = is_array($values) && !empty($values) ? [ return is_array($values) && !empty($values) ? [ 'lat' => (isset($values[1]) && is_numeric($values[1]) && $values[1] >= -90 && $values[1] <= 90) ? floatval($values[1]) : FALSE, 'lon' => (isset($values[2]) && is_numeric($values[2]) && $values[2] >= -180 && $values[2] <= 180) ? floatval($values[2]) : FALSE, 'operator' => (isset($values[3]) && in_array($values[3], [ Loading @@ -226,9 +222,6 @@ class GeofieldProximityArgument extends Formula implements ContainerFactoryPlugi 'distance' => (isset($values[4])) ? floatval($values[4]) : FALSE, 'units' => (isset($values[5]) && array_key_exists($values[5], $this->units)) ? $this->units[$values[5]]['value'] : 'GEOFIELD_KILOMETERS', ] : FALSE; } return $values; } }