PluginProbe
Fluent Support – Helpdesk & Customer Support Ticket System / 2.1.1
Fluent Support – Helpdesk & Customer Support Ticket System v2.1.1
2.3.2 2.3.1 2.3.0 2.2.1 2.2.0 trunk 1.10.0 1.10.1 1.10.2 1.10.3 1.10.4 1.10.5 1.4.0 1.4.1 1.4.2 1.4.5 1.4.6 1.4.7 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.5.5 1.5.6 All 67 releases
← All changes | app/Http/Controllers/AgentController.php +4 -10 trunk2.1.1 View file →
@@ -169,19 +169,15 @@
169 169
170 170 /**
171 171 * resetAvatar method will restore a Support Staff avatar
172 172 * For a successful upload it's required to send file object, Support Staff id and the user type(Support Staff)
173 - *
174 - * No Agent type-hint here: route-model binding resolves inside the
175 - * permission callback, before any policy runs, which lets unauthenticated
176 - * callers probe agent ID existence (FS-PERM-001). Resolve after auth.
177 - * @param int|string $agent
173 + * @param Agent $agent
174 + * @param $agent_id
178 175 * @return array
179 176 */
180 - public function resetAvatar($agent)
177 + public function resetAvatar(Agent $agent)
181 178 {
182 179 try {
183 - $agent = Agent::findOrFail((int) $agent);
184 180 $agent->restoreAvatar();
185 181
186 182 return [
187 183 'message' => __('Support Staff avatar reset to gravatar default', 'fluent-support')
@@ -227,11 +223,9 @@
227 223 'restrictions' => $this->sanitizeRestrictions($request->get('restrictions')),
228 224 ];
229 225
230 226 if ($request->has('agent_signature')) {
231 - // Already unslashed at the request boundary; sanitize only, so literal
232 - // backslashes in the signature survive.
233 - $data['agent_signature'] = wp_kses_post($request->get('agent_signature', ''));
227 + $data['agent_signature'] = wp_kses_post(wp_unslash($request->get('agent_signature', '')));
234 228 }
235 229
236 230 if ($request->has('agent_signature_enabled')) {
237 231 $data['agent_signature_enabled'] = $request->get('agent_signature_enabled') === 'yes' ? 'yes' : 'no';