Plugin Directory

Changeset 358568


Ignore:
Timestamp:
03/11/2011 01:11:48 AM (15 years ago)
Author:
bsterne
Message:

fixed a bug where .attr() return val was undefined at times

Location:
content-security-policy/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • content-security-policy/trunk/csp-options-page.php

    r358553 r358568  
    2121specific types of content are expected.  To provide protection in this way, CSP
    2222fundamentally changes the way JavaScript can be embedded in web pages, so be
    23 aware that <b>WordPress plugins may experience broken functionality</b> when CSP
    24 is enabled.</p>
     23aware that <b>WordPress plugins and themes may experience broken
     24functionality</b> when CSP is enabled.</p>
    2525<table class="form-table" id="csp-form">
    2626<tr valign="top">
  • content-security-policy/trunk/script/csp-options.js

    r358553 r358568  
    7474  // only from this site
    7575  if (policy == "allow 'self';") {
    76     var myHost = jQuery.url.setUrl($(this).attr("src")).attr("host");
     76    var myHost = jQuery.url.setUrl(window.location.href).attr("host");
    7777    // show non-editable policy representation.  we don't want them to be able
    7878    // to remove "allow 'self'" (at least through the visual policy editor).
     
    444444  // the printed list will be interactive
    445445  function showVisualPolicy(sourceList, elementID, editable) {
    446     if(DEBUG) $("#log").text(display(sourceList))
     446    if (DEBUG) $("#log").text(display(sourceList))
    447447    $("#"+elementID).empty();
    448     var myHost = jQuery.url.setUrl($(this).attr("src")).attr("host");
     448    var myHost = jQuery.url.setUrl(window.location.href).attr("host");
    449449    for (type in sourceList) {
    450450      var div = document.createElement("div");
Note: See TracChangeset for help on using the changeset viewer.