From 50c492c5a637d614346f6c657a9f67363d382f2b Mon Sep 17 00:00:00 2001 From: azett Date: Wed, 3 Oct 2018 14:07:38 +0200 Subject: [PATCH] Replaced deprecated each() in footnotes plugin. --- fp-plugins/footnotes/plugin.footnotes.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/fp-plugins/footnotes/plugin.footnotes.php b/fp-plugins/footnotes/plugin.footnotes.php index 276f5b9..20a4460 100755 --- a/fp-plugins/footnotes/plugin.footnotes.php +++ b/fp-plugins/footnotes/plugin.footnotes.php @@ -38,14 +38,16 @@ class footnotes_class { $lines = preg_split('|\[([0-9]+)\]|', $matches[1], -1, PREG_SPLIT_DELIM_CAPTURE); + // first array element is always empty - remove array_shift($lines); - while ((list (,$n) = each($lines)) && (list (,$s) = each($lines))) + // get each footnote's number ($n) and content ($s) from the array ... + while (($n = array_shift($lines)) && ($s = array_shift($lines))) { + // ... and add it to the result string $str .=$this->note($n, $s); - + } $str .= ''; - return $str; }