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

T. Michael Sommers tmsommers2 at gmail.com
Tue May 4 20:39:23 PDT 2021


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][] = "<!--$k-->";
-    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 -- tmsommers2 at gmail.com -- ab2sb



More information about the pmwiki-users mailing list