AMP_Img_Sanitizer::filter_attributes PHP Method

filter_attributes() private method

private filter_attributes ( $attributes )
    private function filter_attributes($attributes)
    {
        $out = array();
        foreach ($attributes as $name => $value) {
            switch ($name) {
                case 'src':
                case 'alt':
                case 'class':
                case 'srcset':
                case 'sizes':
                case 'on':
                    $out[$name] = $value;
                    break;
                case 'width':
                case 'height':
                    $out[$name] = $this->sanitize_dimension($value, $name);
                    break;
                default:
                    break;
            }
        }
        return $out;
    }