Re: [pmwiki-users] pmwiki.php: Array and string offset access syntax with curly braces is deprecated

2021-05-05 Thread T. Michael Sommers

On 05/05/21 00:30, Petko Yotov wrote:
Thank you for the message and the diffs but this has already been fixed 
this was fixed in 2.2.119 (2019-10-03), that is 19 months ago and 19 
versions released since then:


D'oh!  I downloaded the current version a few weeks ago, but when I 
untarred it yesterday I used an older version I had lying around.  2.2.118.


Sorry about that.

--
T.M. Sommers -- tmsomme...@gmail.com -- ab2sb

___
pmwiki-users mailing list
pmwiki-users@pmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-users


[pmwiki-users] pmwiki.php: Function get_magic_quotes_gpc() is deprecated

2021-05-04 Thread T. Michael Sommers
I have a brand new installation of pmwiki, from a tarball downloaded a 
few weeks ago.  I am using php 7.4.3 on FreeBSD 11.2-RELEASE-p3.  I get 
a warning saying, "Function get_magic_quotes_gpc() is deprecated in 
/home/www/data/pmwiki/pmwiki.php on line 434"


I don't know how to fix this.

--
T.M. Sommers -- tmsomme...@gmail.com -- ab2sb

___
pmwiki-users mailing list
pmwiki-users@pmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-users


[pmwiki-users] skins.php: Array and string offset access syntax with curly braces is deprecated

2021-05-04 Thread T. Michael Sommers
I have a brand new installation of pmwiki, from a tarball downloaded a 
few weeks ago.  I am using php 7.4.3 on FreeBSD 11.2-RELEASE-p3.  I get 
a warning saying, "Array and string offset access syntax with curly 
braces is deprecated" for scripts/skins.php.


This is a diff that fixes them:

--- snip ---
--- skins.php.orig  2021-05-04 23:32:01.196248000 -0400
+++ skins.php   2021-05-04 23:33:12.017707000 -0400
@@ -130,7 +130,7 @@
 $v = preg_split("/$SkinDirectivesPattern/s",
   array_shift($sect),0,PREG_SPLIT_DELIM_CAPTURE);
 $TmplFmt[$ps][] = "";
-if ($k{0} == '/')
+if ($k[0] == '/')
   { $TmplFmt[$ps][] = (count($v) > 1) ? $v : $v[0]; continue; }
 @list($var, $sd) = explode(' ', $k, 2);
 $GLOBALS[$var] = (count($v) > 1) ? $v : $v[0];
--- snip---

--
T.M. Sommers -- tmsomme...@gmail.com -- ab2sb

___
pmwiki-users mailing list
pmwiki-users@pmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-users


[pmwiki-users] pagelist.php: Array and string offset access syntax with curly braces is deprecated

2021-05-04 Thread T. Michael Sommers
I have a brand new installation of pmwiki, from a tarball downloaded a 
few weeks ago.  I am using php 7.4.3 on FreeBSD 11.2-RELEASE-p3.  I get 
warnings saying, "Array and string offset access syntax with curly 
braces is deprecated" for scripts/pagelist.php.


This is a diff that fixes them:

--- snip ---
--- pagelist.php.orig   2021-05-04 23:36:16.309938000 -0400
+++ pagelist.php2021-05-04 23:37:48.634086000 -0400
@@ -434,7 +434,7 @@
   if (preg_match($i, $text)) return 0;
 foreach((array)@$opt['=inclp'] as $i)
   if (!preg_match($i, $text)) {
-if ($i{0} == '$') $reindex[] = $pn;
+if ($i[0] == '$') $reindex[] = $pn;
 return 0;
   }
   }
@@ -488,9 +488,9 @@
   as $o) {
 $ret |= PAGELIST_POST;
 $r = '+';
-if ($o{0} == '-') { $r = '-'; $o = substr($o, 1); }
+if ($o[0] == '-') { $r = '-'; $o = substr($o, 1); }
 $opt['=order'][$o] = $r;
-if ($o{0} != '$' &&
+if ($o[0] != '$' &&
 (!isset($PageListSortRead[$o]) || $PageListSortRead[$o]))
   $ret |= PAGELIST_ITEM;
   }
--- snip ---

--
T.M. Sommers -- tmsomme...@gmail.com -- ab2sb

___
pmwiki-users mailing list
pmwiki-users@pmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-users


[pmwiki-users] pmwiki.php: Array and string offset access syntax with curly braces is deprecated

2021-05-04 Thread T. Michael Sommers
I have a brand new installation of pmwiki, from a tarball downloaded a 
few weeks ago.  I am using php 7.4.3 on FreeBSD 11.2-RELEASE-p3.  I get 
a lot of warnings saying, "Array and string offset access syntax with 
curly braces is deprecated" for pmwiki.php.


This is a diff that fixes them:

--- snip ---
--- pmwiki.php.orig 2021-05-04 23:00:53.048909000 -0400
+++ pmwiki.php  2021-05-04 23:25:24.454431000 -0400
@@ -703,7 +703,7 @@
  array('.*',  '.',   '[',   ']',   '^', '-', '!'), 
$pat);

   $excl = array(); $incl = array();
   foreach(preg_split('/,+\s?/', $pat, -1, PREG_SPLIT_NO_EMPTY) as $p) {
-if ($p{0} == '-' || $p{0} == '!') $excl[] = '^'.substr($p, 1).'$';
+if ($p[0] == '-' || $p[0] == '!') $excl[] = '^'.substr($p, 1).'$';
 else $incl[] = "^$p$";
   }
   return array(implode('|', $incl), implode('|', $excl));
@@ -733,7 +733,7 @@
   foreach((array)$pat as $p) {
 if (count($pagelist) < 1) break;
 if (!$p) continue;
-switch ($p{0}) {
+switch ($p[0]) {
   case '/':
 $pagelist = preg_grep($p, $pagelist);
 break;
@@ -1009,7 +1009,7 @@
   foreach($a as $k=>$v) {
 if (!isset($XL[$lang][$k])) {
   if (preg_match('/^e_(rows|cols)$/', $k)) $v = intval($v);
-  elseif (preg_match('/^ak_/', $k)) $v = $v{0};
+  elseif (preg_match('/^ak_/', $k)) $v = $v[0];
   $XL[$lang][$k]=$v;
 }
   }
@@ -1151,7 +1151,7 @@
   $x = "version=$Version ordered=1 urlencoded=1\n";
   $s = true && fputs($fp, $x); $sz = strlen($x);
   foreach($page as $k=>$v)
-if ($k > '' && $k{0} != '=') {
+if ($k > '' && $k[0] != '=') {
   $x = str_replace($r0, $r1, "$k=$v") . "\n";
   $s = $s && fputs($fp, $x); $sz += strlen($x);
 }
@@ -1192,7 +1192,7 @@
   $dirslash = substr_count($dir, '/') + 1;
   $o = array();
   while ( ($pagefile = readdir($dfp)) !== false) {
-if ($pagefile{0} == '.') continue;
+if ($pagefile[0] == '.') continue;
 if ($dirslash < $maxslash && is_dir("$dir/$pagefile"))
   { array_push($dirlist,"$dir/$pagefile"); continue; }
 if ($dirslash == $maxslash) $o[] = $this->PFD($pagefile);
@@ -1441,7 +1441,7 @@
 ##  The caller is responsible for calling Qualify() as needed.
 function RetrieveAuthSection($pagename, $pagesection, $list=NULL, 
$auth='read') {

   global $RASPageName, $PCache;
-  if ($pagesection{0} != '#')
+  if ($pagesection[0] != '#')
 $list = array(MakePageName($pagename, $pagesection));
   else if (is_null($list)) $list = array($pagename);
   foreach((array)$list as $t) {
@@ -1465,7 +1465,7 @@
   while (count($args['#'])>0) {
 $k = array_shift($args['#']); $v = array_shift($args['#']);
 if ($k=='') {
-  if ($v{0} != '#') {
+  if ($v[0] != '#') {
 if (isset($itext)) continue;
 $iname = MakePageName($pagename, $v);
 if (!$args['self'] && $iname == $pagename) continue;
@@ -1478,7 +1478,7 @@
 if (preg_match('/^(?:line|para)s?$/', $k)) {
   preg_match('/^(\\d*)(\\.\\.(\\d*))?$/', $v, $match);
   @list($x, $a, $dots, $b) = $match;
-  $upat = ($k{0} == 'p') ? ".*?(\n\\s*\n|$)" : "[^\n]*(?:\n|$)";
+  $upat = ($k[0] == 'p') ? ".*?(\n\\s*\n|$)" : "[^\n]*(?:\n|$)";
   if (!$dots) { $b=$a; $a=0; }
   if ($a>0) $a--;
   $itext=preg_replace("/^(($upat){0,$b}).*$/s",'$1',$itext,1);
@@ -1640,7 +1640,7 @@
 $suffix = $txt[1];
 $txt = $txt[0];
   }
-  if (!$fmt && $path{0} == '#') {
+  if (!$fmt && $path[0] == '#') {
 $path = preg_replace("/[^-.:\\w]/", '', $path);
 if (trim($txt) == '+') $txt = PageVar($pagename, '$Title') . @$suffix;
 if ($alt) $alt = " title='$alt'";
@@ -1785,7 +1785,7 @@
 foreach($markrules as $p=>$r) {
   list($r, $id) = (array)$r;
   $MarkupToHTML['markupid'] = $id;
-  if ($p{0} == '/') {
+  if ($p[0] == '/') {
 if (is_callable($r)) $x = preg_replace_callback($p,$r,$x);
 else $x=preg_replace($p,$r,$x);
   }
@@ -2209,11 +2209,11 @@
   if ($pw == ',' || $pw == '') continue;
   else if ($pw == ' ') { $x = ''; continue; }
   else if (substr($pw, -1, 1) == ':') { $x = $pw; continue; }
-  else if ($pw{0} != '@' && $x > '') $pw = $x . $pw;
+  else if ($pw[0] != '@' && $x > '') $pw = $x . $pw;
   if (!$pw) continue;
   $passwd[] = $pw;
   if ($auth < 0) continue;
-  if ($x || $pw{0} == '@') {
+  if ($x || $pw[0] == '@') {
 if (@$AuthList[$pw]) $auth = $AuthList[$pw];
 continue;
   }
--- snip ---

--
T.M. Sommers -- tmsomme...@gmail.com -- ab2sb

___
pmwiki-users mailing list
pmwiki-users@pmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-users