Commit fddcc334 authored by git's avatar git Committed by elachlan

Issue #2904994 by Znak: drupal_add_http_header is deprecated

parent 7dea9c7a
......@@ -5,6 +5,8 @@
* Contains functions used in the backend forms.
*/
use Symfony\Component\HttpFoundation\Response;
/**
* Menu handler for font preview request.
*
......@@ -57,8 +59,8 @@ function image_captcha_font_preview($font_token) {
imagettftext($image, $font_size, 0, 1, 1.5 * $font_size, $color, realpath($font), $text);
}
// Set content type.
drupal_add_http_header('Content-Type', 'image/png');
$response = new Response();
$response->headers->set('Content-Type', 'image/png');
// Dump image data to client.
imagepng($image);
// Release image memory.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment