WordPress.org

Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #37082, comment 1


Ignore:
Timestamp:
06/12/2016 05:16:09 PM (3 years ago)
Author:
sgolemon
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #37082, comment 1

    initial v1  
    33Given that these methods are designed to produce XML declaration pairs, I'd like to apply a label/string/uri sanitization such as the following:
    44
    5 public static function defaultMapAttrsFunc($k, $v) {
    6   return preg_replace('/[0-9A-Za-z_-]+/', '', $k) . '="' . filter_var($v, FILTER_SANITIZE_ENCODED) . '"';
    7 }
     5  public static function defaultMapAttrsFunc($k, $v) {
     6    return preg_replace('/[0-9A-Za-z_-]+/', "", $k) . '="' . filter_var($v, FILTER_SANITIZE_ENCODED) . '"';
     7  }
    88
    99and similar in defaultMapXmlnsFunc, of course.