urgent bugfix release 2.2.6 in response to bug report on forum
git-svn-id: https://plugins.svn.wordpress.org/footnotes/trunk@2444735 b8457f37-d9ea-0310-8a92-e5e31aec5664
This commit is contained in:
parent
c8f0c0e350
commit
f3b2f0e864
8 changed files with 113 additions and 45 deletions
|
@ -10,10 +10,14 @@
|
|||
* 2.0.4 restore arrow settings 2020-11-01T0509+0100
|
||||
* 2.1.0 read-on button label 2020-11-08T2148+0100
|
||||
* 2.1.1 options for ref container and alternative tooltips 2020-11-16T2152+0100
|
||||
* 2.1.2 priority level settings for all other hooks, thanks to @nikelaos
|
||||
* @see <https://wordpress.org/support/topic/doesnt-work-any-more-11/#post-13676705>
|
||||
* 2.1.4 settings for ref container, tooltips and scrolling 2020-12-03T0950+0100
|
||||
* 2.1.6 slight UI reordering 2020-12-09T1114+0100
|
||||
* 2.1.6 option to disable URL line wrapping 2020-12-09T1604+0100
|
||||
* 2.1.6 remove expert mode setting as outdated 2020-12-09T2105+0100
|
||||
* 2.2.0 start/end short codes: more predefined options, thanks to @nikelaos
|
||||
* @see <https://wordpress.org/support/topic/doesnt-work-with-mailpoet/>
|
||||
* 2.2.0 add options, redistribute, update strings 2020-12-12T2135+0100
|
||||
* 2.2.0 shortcode for reference container custom position 2020-12-13T2055+0100
|
||||
* 2.2.2 Custom CSS settings container migration 2020-12-15T0709+0100
|
||||
|
@ -23,7 +27,7 @@
|
|||
* 2.2.5 options for label element and label bottom border, thanks to @markhillyer 2020-12-18T1447+0100
|
||||
* @see <https://wordpress.org/support/topic/how-do-i-eliminate-the-horizontal-line-beneath-the-reference-container-heading/>
|
||||
*
|
||||
* Last modified: 2020-12-18T1631+0100
|
||||
* Last modified: 2020-12-20T0533+0100
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -308,7 +312,8 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_LayoutEngine {
|
|||
* @since 1.5.0
|
||||
*
|
||||
* Edited heading 2020-12-12T1412+0100
|
||||
* @since 2.2.0 more short code options 2020-12-12T1412+0100
|
||||
* @since 2.2.0 start/end short codes: more predefined options, thanks to @nikelaos 2020-12-12T1412+0100
|
||||
* @see <https://wordpress.org/support/topic/doesnt-work-with-mailpoet/>
|
||||
* @since 2.2.0 3 boxes for clarity 2020-12-12T1422+0100
|
||||
* @since 2.2.5 support for Ibid. notation thanks to @meglio 2020-12-17T2019+0100
|
||||
* @see <https://wordpress.org/support/topic/add-support-for-ibid-notation/>
|
||||
|
@ -485,7 +490,8 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_LayoutEngine {
|
|||
* @since 1.5.0
|
||||
*
|
||||
* Edited heading 2020-12-12T1453+0100
|
||||
* @since 2.1.1 more settings and notices
|
||||
* @since 2.1.1 more settings and notices, thanks to @nikelaos
|
||||
* @see <https://wordpress.org/support/topic/doesnt-work-any-more-11/#post-13687068>
|
||||
* @since 2.2.0 dedicated to the excerpt setting and its notices 2020-12-12T1454+0100
|
||||
*/
|
||||
public function Excerpts() {
|
||||
|
|
|
@ -17,10 +17,12 @@
|
|||
* @see <https://wordpress.org/support/topic/possible-to-hide-it-from-start-page/>
|
||||
* 2.1.1 fix ref container by option restoring 3-column layout
|
||||
* 2.1.1 fix ref container by option to switch index/symbol 2020-11-16T2022+0100
|
||||
* @since 2.1.3 excerpt hook: disable by default, thanks to @nikelaos
|
||||
* @see <https://wordpress.org/support/topic/doesnt-work-any-more-11/#post-13687068>
|
||||
* 2.1.3 fix ref container positioning by priority level 2020-11-17T0205+0100
|
||||
* 2.1.4 more settings container keys 2020-12-03T0955+0100
|
||||
* 2.1.6 option to disable URL line wrapping 2020-12-09T1606+0100
|
||||
* 2.1.6 set default priority level of the_content to 98 2020-12-10T0447+0100
|
||||
* 2.1.6 set default priority level of the_content to 98 to prevent plugin conflict, thanks to @marthalindeman 2020-12-10T0447+0100
|
||||
* 2.2.0 reference container custom position shortcode, thanks to @hamshe 2020-12-13T2056+0100
|
||||
* @see <https://wordpress.org/support/topic/reference-container-in-elementor/>
|
||||
* 2.2.2 Custom CSS settings container migration 2020-12-15T0709+0100
|
||||
|
@ -29,7 +31,7 @@
|
|||
* 2.2.5 options for reference container label element and bottom border, thanks to @markhillyer 2020-12-18T1455+0100
|
||||
* @see <https://wordpress.org/support/topic/how-do-i-eliminate-the-horizontal-line-beneath-the-reference-container-heading/>
|
||||
*
|
||||
* Last modified: 2020-12-18T1632+0100
|
||||
* Last modified: 2020-12-20T0518+0100
|
||||
*/
|
||||
|
||||
|
||||
|
@ -397,6 +399,9 @@ class MCI_Footnotes_Settings {
|
|||
* @var string
|
||||
*
|
||||
* 2020-11-16T0859+0100
|
||||
*
|
||||
* option to enable/disable the superscript element for referrers, thanks to @cwbayer
|
||||
* @see <https://wordpress.org/support/topic/footnote-number-in-text-superscript-disrupts-leading/>
|
||||
*/
|
||||
const C_BOOL_FOOTNOTES_REFERRER_SUPERSCRIPT_TAGS = "footnotes_inputfield_referrer_superscript_tags";
|
||||
const C_BOOL_REFERENCE_CONTAINER_BACKLINK_SYMBOL_ENABLE = "footnotes_inputfield_reference_container_backlink_symbol_enable";
|
||||
|
@ -553,6 +558,11 @@ class MCI_Footnotes_Settings {
|
|||
* @author Stefan Herndler
|
||||
* @since 1.5.0
|
||||
* @var array
|
||||
*
|
||||
* Edited multiple times.
|
||||
*
|
||||
* @since 2.1.3 excerpt hook: disable by default, thanks to @nikelaos
|
||||
* @see <https://wordpress.org/support/topic/doesnt-work-any-more-11/#post-13687068>
|
||||
*/
|
||||
private $a_arr_Default = array(
|
||||
|
||||
|
@ -614,7 +624,7 @@ class MCI_Footnotes_Settings {
|
|||
// whether to use link elements:
|
||||
self::C_BOOL_LINK_ELEMENT_ENABLED => 'yes',
|
||||
|
||||
// excerpt should be disabled:
|
||||
// excerpt should be disabled:
|
||||
self::C_BOOL_FOOTNOTES_IN_EXCERPT => 'no',
|
||||
|
||||
// since removal of the_post hook, expert mode is no danger zone
|
||||
|
|
|
@ -19,8 +19,10 @@
|
|||
* 2.1.1 fix start pages by option to hide ref container, thanks to @dragon013
|
||||
* @see <https://wordpress.org/support/topic/possible-to-hide-it-from-start-page/>
|
||||
* 2.1.1 options fixing ref container layout and referrer vertical alignment 2020-11-16T2024+0100
|
||||
* 2.1.1 option fixing ref container relative position 2020-11-17T0254+0100
|
||||
* 2.1.2 options for the other hooks 2020-11-19T1849+0100
|
||||
* 2.1.1 priority level option fixing ref container relative position, thanks to june01, @spaceling, @imeson 2020-11-17T0254+0100
|
||||
* @see <https://wordpress.org/support/topic/change-the-position-5/>
|
||||
* 2.1.2 priority level settings for all other hooks, thanks to @nikelaos 2020-11-19T1849+0100
|
||||
* @see <https://wordpress.org/support/topic/doesnt-work-any-more-11/#post-13676705>
|
||||
* 2.1.4 fix line wrapping of URLs based on pattern, not link element 2020-11-25T0837+0100
|
||||
* 2.1.4 fix issues with link elements by making them optional 2020-11-26T1051+0100
|
||||
* 2.1.4 support appending arrow when combining identicals is on 2020-11-26T1633+0100
|
||||
|
@ -29,8 +31,11 @@
|
|||
* 2.1.4 ref container column width and tooltip font size settings 2020-12-03T0954+0100
|
||||
* 2.1.4 scroll offset and duration settings 2020-12-05T0538+0100
|
||||
* 2.1.4 tooltip display duration settings 2020-12-06T1320+0100
|
||||
* 2.1.5 URL wrap: exclude image source too, thanks to @bjrnet21
|
||||
* @see <https://wordpress.org/support/topic/2-1-4-breaks-on-my-site-images-dont-show/>
|
||||
* 2.1.6 option to disable URL line wrapping 2020-12-09T1606+0100
|
||||
* 2.1.6 add catch-all exclusion to fix URL line wrapping 2020-12-09T1921+0100
|
||||
* 2.1.6 add catch-all exclusion to fix URL line wrapping, thanks to @a223123131 2020-12-09T1921+0100
|
||||
* @see <https://wordpress.org/support/topic/broken-layout-starting-version-2-1-4/>
|
||||
* 2.2.0 support for custom position shortcode for reference container, thanks to @hamshe 2020-12-13T2058+0100
|
||||
* @see <https://wordpress.org/support/topic/reference-container-in-elementor/>
|
||||
* 2.2.3 custom CSS from new setting in header after legacy 2020-12-15T1128+0100
|
||||
|
@ -39,8 +44,10 @@
|
|||
* @see <https://wordpress.org/support/topic/reference-container-in-elementor/#post-13784126>
|
||||
* 2.2.5 options for label element and label bottom border, thanks to @markhillyer 2020-12-18T1447+0100
|
||||
* @see <https://wordpress.org/support/topic/how-do-i-eliminate-the-horizontal-line-beneath-the-reference-container-heading/>
|
||||
* 2.2.6 URL wrap: make the quotation mark optional in the exclusion regex, thanks to @spiralofhope2 2020-12-23T0409+0100
|
||||
* @see <https://wordpress.org/support/topic/two-links-now-breaks-footnotes-with-blogtext/>
|
||||
*
|
||||
* Last modified: 2020-12-18T1751+0100
|
||||
* Last modified: 2020-12-23T0423+0100
|
||||
*/
|
||||
|
||||
// If called directly, abort:
|
||||
|
@ -641,13 +648,30 @@ class MCI_Footnotes_Task {
|
|||
// get footnote text
|
||||
$l_str_FootnoteText = substr($p_str_Content, $l_int_PosStart + strlen($l_str_StartingTag), $l_int_Length - strlen($l_str_StartingTag));
|
||||
|
||||
// fix line wrapping of URLs (hyperlinked or not) based on pattern, not link element,
|
||||
// to prevent them from hanging out of the tooltip in non-Unicode-compliant user agents.
|
||||
// spare however values of the href and the src arguments!
|
||||
// Even ARIA labels may take an URL as value, so use \w=[\'"] as a catch-all 2020-12-10T1005+0100
|
||||
// see public.css
|
||||
|
||||
/**
|
||||
* URL line wrap
|
||||
*
|
||||
* Fix line wrapping of URLs (hyperlinked or not) based on pattern, not link element,
|
||||
* to prevent them from hanging out of the tooltip in non-Unicode-compliant user agents.
|
||||
* @see public.css
|
||||
*
|
||||
* spare however values of the href and the src arguments!
|
||||
* @since 2.1.5 exclude image source too, thanks to @bjrnet21
|
||||
* @see <https://wordpress.org/support/topic/2-1-4-breaks-on-my-site-images-dont-show/>
|
||||
*
|
||||
* Even ARIA labels may take a URL as value, so use \w=[\'"] as a catch-all 2020-12-10T1005+0100
|
||||
* @since 2.1.6 add catch-all exclusion to fix URL line wrapping, thanks to @a223123131 2020-12-09T1921+0100
|
||||
* @see <https://wordpress.org/support/topic/broken-layout-starting-version-2-1-4/>
|
||||
*
|
||||
* @since 2.1.6 option to disable URL line wrapping 2020-12-09T1606+0100
|
||||
*
|
||||
* URLs may be a query string in a URL:
|
||||
* @since 2.2.6 make the quotation mark optional in the exclusion regex, thanks to @spiralofhope2 2020-12-23T0409+0100
|
||||
* @see <https://wordpress.org/support/topic/two-links-now-breaks-footnotes-with-blogtext/>
|
||||
*/
|
||||
if (MCI_Footnotes_Convert::toBool(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_BOOL_FOOTNOTE_URL_WRAP_ENABLED))) {
|
||||
$l_str_FootnoteText = preg_replace( '#(?<!\w=[\'"])(https?://[^\\s<]+)#', '<span class="footnote_url_wrap">$1</span>', $l_str_FootnoteText );
|
||||
$l_str_FootnoteText = preg_replace( '#(?<!\w=[\'"]?)(https?://[^\\s<]+)#', '<span class="footnote_url_wrap">$1</span>', $l_str_FootnoteText );
|
||||
}
|
||||
|
||||
// Text to be displayed instead of the footnote
|
||||
|
@ -775,7 +799,8 @@ class MCI_Footnotes_Task {
|
|||
* INFINITE SCROLL / AUTOLOAD, ARCHIVE VIEW
|
||||
*
|
||||
* Multiple posts are appended to each other, functions and IDs must be disambiguated.
|
||||
* Contributed by @docteurfitness <https://wordpress.org/support/topic/auto-load-post-compatibility-update/>
|
||||
* Contributed by @docteurfitness
|
||||
* @see <https://wordpress.org/support/topic/auto-load-post-compatibility-update/>
|
||||
* @since 2.0.5
|
||||
*
|
||||
* post ID to make everything unique wrt infinite scroll and archive view:
|
||||
|
@ -801,12 +826,11 @@ class MCI_Footnotes_Task {
|
|||
* Browsers may need to be prevented from logging these clicks in the browsing history,
|
||||
* as logging compromises the usability of the 'return to previous' button in browsers.
|
||||
* For that purpose, and for scroll animation, this linking is performed by JavaScript.
|
||||
*
|
||||
*
|
||||
* The link elements have been added and are present @since 2.0.0.
|
||||
* Then the link addresses were removed @since 2.0.4.
|
||||
* Then the presence of <a> elements was made optional
|
||||
* @since 2.1.4
|
||||
* 2020-11-25T1306+0100
|
||||
* @since 2.0.0 the link elements have been added and are present.
|
||||
* @since 2.0.4 the link addresses were removed.
|
||||
* @since 2.1.4 the presence of <a> elements was made optional, 2020-11-25T1306+0100
|
||||
*/
|
||||
$l_str_LinkSpan = MCI_Footnotes_Convert::toBool(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_BOOL_LINK_ELEMENT_ENABLED)) ? 'a' : 'span';
|
||||
|
||||
|
|
|
@ -10,9 +10,10 @@
|
|||
* @since 2.0.3 further minify template content
|
||||
* @since 2.0.4 regex to delete multiple spaces
|
||||
*
|
||||
* @since 2.3.0 support for custom templates 2020-12-19T0606+0100
|
||||
* @since 2.3.0 support for custom templates in fixed location, while failing to add filter thanks to @misfist 2020-12-19T0606+0100
|
||||
* @see <https://wordpress.org/support/topic/template-override-filter/#post-13811141>
|
||||
*
|
||||
* Last modified: 2020-12-19T0713+0100
|
||||
* Last modified: 2020-12-20T0200+0100
|
||||
*/
|
||||
|
||||
|
||||
|
@ -75,6 +76,9 @@ class MCI_Footnotes_Template {
|
|||
* @since 2.0.4 regex to delete multiple spaces
|
||||
*
|
||||
* @since 2.3.0 support for custom templates 2020-12-19T0606+0100
|
||||
* @see <https://wordpress.org/support/topic/template-override-filter/#post-13811141>
|
||||
*
|
||||
* @since 2.3.0 regex to delete space before >
|
||||
*/
|
||||
public function __construct($p_str_FileType, $p_str_FileName, $p_str_Extension = "html") {
|
||||
// no template file type and/or file name set
|
||||
|
@ -87,6 +91,7 @@ class MCI_Footnotes_Template {
|
|||
$l_str_TemplateFile = dirname(__FILE__) . "/../../footnotes-custom/templates/" . $p_str_FileType . "/" . $p_str_FileName . "." . $p_str_Extension;
|
||||
if (!file_exists($l_str_TemplateFile)) {
|
||||
|
||||
// else load internal template:
|
||||
// get absolute path to the specified template file
|
||||
$l_str_TemplateFile = dirname(__FILE__) . "/../templates/" . $p_str_FileType . "/" . $p_str_FileName . "." . $p_str_Extension;
|
||||
// Template file does not exist
|
||||
|
@ -95,11 +100,13 @@ class MCI_Footnotes_Template {
|
|||
}
|
||||
}
|
||||
|
||||
// minify template to some extent:
|
||||
// get Template file content
|
||||
$this->a_str_OriginalContent = str_replace("\n", "", file_get_contents($l_str_TemplateFile));
|
||||
$this->a_str_OriginalContent = str_replace("\r", "", $this->a_str_OriginalContent);
|
||||
$this->a_str_OriginalContent = str_replace("\t", " ", $this->a_str_OriginalContent);
|
||||
$this->a_str_OriginalContent = preg_replace('# +#', " ", $this->a_str_OriginalContent);
|
||||
$this->a_str_OriginalContent = str_replace(" >", ">", $this->a_str_OriginalContent);
|
||||
$this->reload();
|
||||
}
|
||||
|
||||
|
|
Reference in a new issue