Plugin Directory

Changeset 3451502


Ignore:
Timestamp:
02/01/2026 05:00:19 PM (8 weeks ago)
Author:
Jonua
Message:

v1.3.34

  • Allows the target="_blank" attribute on links
  • Adds a filter that ensures links using target="_blank" are automatically given rel="noopener"
Location:
advanced-custom-fields-table-field/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • advanced-custom-fields-table-field/trunk/acf-table.php

    r3414476 r3451502  
    44Plugin URI: https://www.acf-table-field.com
    55Description: This free Add-on adds a table field type for the plugins Advanced Custom Fields and Secure Custom Fields.
    6 Version: 1.3.33
     6Version: 1.3.34
    77Author: Johann Heyne
    88Author URI: http://www.johannheyne.de
  • advanced-custom-fields-table-field/trunk/changelog.txt

    r3414476 r3451502  
    11== Changelog ==
     2
     3= 1.3.34 =
     4* Allows the target="_blank" attribute on links
     5* Adds a filter that ensures links using target="_blank" are automatically given rel="noopener"
    26
    37= 1.3.33 =
  • advanced-custom-fields-table-field/trunk/class-jh-acf-field-table.php

    r3414476 r3451502  
    4040        */
    4141        $this->settings = array(
    42             'version' => '1.3.33',
     42            'version' => '1.3.34',
    4343            'dir_url' => plugins_url( '', __FILE__ ) . '/',
    4444        );
  • advanced-custom-fields-table-field/trunk/js/init.js

    r3414476 r3451502  
    77        var t = this;
    88
    9         t.version = '1.3.33';
     9        t.version = '1.3.34';
    1010
    1111        t.param = {};
     
    16041604                USE_PROFILES: {
    16051605                    html: true
    1606                 }
     1606                },
     1607                ADD_ATTR: ['target']
    16071608            };
    16081609
     
    16101611
    16111612            string = t.DOMPurify.sanitize( string, options );
     1613            string = t.addNoopenerToHtmlString( string );
    16121614
    16131615            return string;
    16141616        };
     1617
     1618        t.addNoopenerToHtmlString = function (html) {
     1619            const parser = new DOMParser();
     1620            const doc = parser.parseFromString(html, "text/html");
     1621
     1622            doc.querySelectorAll('a[target="_blank"]').forEach(link => {
     1623                const rel = link.getAttribute('rel');
     1624
     1625                if (!rel) {
     1626                    link.setAttribute('rel', 'noopener');
     1627                } else if (!rel.split(/\s+/).includes('noopener')) {
     1628                    link.setAttribute('rel', rel + ' noopener');
     1629                }
     1630            });
     1631
     1632            return doc.body.innerHTML;
     1633        }
    16151634
    16161635        t.DOMPurify = (function () {
  • advanced-custom-fields-table-field/trunk/readme.txt

    r3414484 r3451502  
    44Requires at least: 5.3
    55Tested up to: 6.9
    6 Stable tag: 1.3.33
     6Stable tag: 1.3.34
    77Requires PHP: 7.4
    88License: GPLv2 or later
     
    489489        // DOMPurify Options, @see: https://github.com/cure53/DOMPurify?tab=readme-ov-file#can-i-configure-dompurify
    490490
    491         options.ADD_ATTR = ['target']; // For instance, the target attribute can be permitted
    492 
    493491        return options;
    494492    });
     
    552550== Changelog ==
    553551
     552= 1.3.34 =
     553* Allows the target="_blank" attribute on links
     554* Adds a filter that ensures links using target="_blank" are automatically given rel="noopener"
     555
    554556= 1.3.33 =
    555557* Adds hook registering event "tableFieldRegisterHooks"
Note: See TracChangeset for help on using the changeset viewer.