Advertisement
Guest User

MTM potential patch

a guest
Feb 9th, 2017
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 1.30 KB | None | 0 0
  1. Index: mtm-tag-admin.php
  2. ===================================================================
  3. --- mtm-tag-admin.php   (revision 6)
  4. +++ mtm-tag-admin.php   (working copy)
  5. @@ -20,7 +20,11 @@
  6.         }
  7.         //go through all non-empty values and wp_kses it
  8.         foreach( $values as $k => $v ){
  9. -           $values[$k] = wp_kses(wp_unslash($v), array());
  10. +           if( $k == 'content'){
  11. +               $values[$k] = wp_unslash($v);
  12. +           }else{
  13. +               $values[$k] = wp_kses(wp_unslash($v), array());
  14. +           }
  15.         }
  16.         //now pass cleaned values to parent constructor
  17.         parent::__construct($values);
  18. Index: mtm-tag.php
  19. ===================================================================
  20. --- mtm-tag.php (revision 4)
  21. +++ mtm-tag.php (working copy)
  22. @@ -22,7 +22,12 @@
  23.     public function output(){
  24.         $tag_string = '<meta '.esc_attr($this->type).'="'.esc_attr($this->value).'"';
  25.         if( $this->has_content() ){
  26. -           $tag_string .= ' content="'.esc_attr($this->content).'"';
  27. +           if( $this->type == 'http-equiv' && $this->value == 'Link' ){
  28. +               //escape the attribute but allow for the <url>; format to pass through
  29. +               $tag_string .= ' content="'.preg_replace('/&lt;(.+)&gt;;/', '<$1>;', esc_attr($this->content)).'"';
  30. +           }else{
  31. +               $tag_string .= ' content="'.esc_attr($this->content).'"';
  32. +           }
  33.         }
  34.         $tag_string .= ' />';
  35.         return $tag_string;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement