Skip to content

Commit 16ffdc1

Browse files
authored
Merge pull request #13 from prajapati-kaushik/7094-protect-against-xss
perf: protect against xss #7094
2 parents 0854b0c + ab2206f commit 16ffdc1

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Services/FieldResolver.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,11 @@ public function resolve($source, $args, $context, ResolveInfo $info)
103103
}
104104
}
105105

106+
if (!empty($fieldConfig['sanitize'])) {
107+
$value = $property ?? '';
108+
return htmlspecialchars($value);
109+
}
110+
106111
return $property instanceof \Closure ? $property($source, $args, $context) : $property;
107112
}
108113
}

0 commit comments

Comments
 (0)