| @@ -24,19 +24,22 @@ | ||
| 24 | 24 | */ |
| 25 | 25 | protected $tag_format = self::META_PROPERTY_CONTENT; |
| 26 | 26 | |
| 27 | 27 | /** |
| 28 | - * Run the Open Graph description through replace vars and the `wpseo_opengraph_desc` filter. | |
| 28 | + * Run the Open Graph description through replace vars and the `wpseo_opengraph_desc` filter and sanitization. | |
| 29 | 29 | * |
| 30 | 30 | * @return string The filtered description. |
| 31 | 31 | */ |
| 32 | 32 | public function get() { |
| 33 | + $meta_og_description = $this->replace_vars( $this->presentation->open_graph_description ); | |
| 34 | + | |
| 33 | 35 | /** |
| 34 | 36 | * Filter: 'wpseo_opengraph_desc' - Allow changing the Yoast SEO generated Open Graph description. |
| 35 | 37 | * |
| 36 | - * @api string The description. | |
| 37 | - * | |
| 38 | + * @param string $description The description. | |
| 38 | 39 | * @param Indexable_Presentation $presentation The presentation of an indexable. |
| 39 | 40 | */ |
| 40 | - return \trim( \apply_filters( 'wpseo_opengraph_desc', $this->replace_vars( $this->presentation->open_graph_description ), $this->presentation ) ); | |
| 41 | + $meta_og_description = \apply_filters( 'wpseo_opengraph_desc', $meta_og_description, $this->presentation ); | |
| 42 | + $meta_og_description = $this->helpers->string->strip_all_tags( \stripslashes( $meta_og_description ) ); | |
| 43 | + return \trim( $meta_og_description ); | |
| 41 | 44 | } |
| 42 | 45 | } |