Trying to access array offset on value of type bool

Aperta
#162 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
52/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
php
Ambito
backend

Direzione di ricerca

Start with /wp-content/plugins/adminimize/inc-setup/dashboard.php at line 154 and reproduce the problem by opening /wp-admin/index.php under PHP 8. Check how $value is populated before the array access. Done means the dashboard loads without repeated warnings and its menu items remain visible, while submenu pages continue to work.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

We are currently switching our websites from PHP 7.4 to PHP 8 and encountered an issue in the WP dashboard (/wp-admin/index.php).

Warning: Trying to access array offset on value of type bool in /public_html/wp-content/plugins/adminimize/inc-setup/dashboard.php on line 154

Here is the line in question:

$value['title'] = ($value['title'] == FALSE) ? [] : $value['title'];

I think there needs to be another check if $value is an array. I came across this a couple times since switching to PHP 8.

The warnings show up above the div#wpwrap about 70 times or so and make the dashboard nigh unusable. Sometimes the menu items just disappear. As soon as you're in one of the submenus the warnings disappear and you can use the dashboard normally as long as you don't go back to /wp-admin/index.php.

Lingua principale
PHP
Stelle
102
Fork
34
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di wp-media/adminimize

Tutte le issue di wp-media/adminimize

Issue simili

Altre issue su PHP

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.