php / php/php-src

JSON_ERROR_DEPTH with JSON_PARTIAL_OUTPUT_ON_ERROR.

Aperta
#13,258 3 commenti 1 reazione 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Extension: json Feature
Lingua principale
C
Stelle
40.4k
Fork
8.1k
Merge medio
2g 13h
PR unite (30g)
96

Descrizione

Description

Hi, json_encode, when it exceeds the max depth, having the flag JSON_PARTIAL_OUTPUT_ON_ERROR, just ignores the max depth and goes on. Shouldn't be a better choice to stop at that depth, replacing by null, for example, following the "partial output" sense as with JSON_ERROR_RECURSION?
Ignoring the optional depth limit seems a bug and truncating the chain of references with null, giving a partial output seems natural.
It seems a trivial change in the sources, thank you.

Guida per i contributori

Apri la guida per i contributori

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.

Direzione di ricerca

Inizia riproducendo json_encode con JSON_PARTIAL_OUTPUT_ON_ERROR su dati che superano la profondità configurata, quindi segui l’implementazione della codifica JSON nel codice sorgente di PHP. Il lavoro è completato quando il limite di profondità viene rispettato e l’output è parziale, ad esempio sostituendo con null il valore che supera la profondità massima, con una copertura di regressione per questo caso.

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

Valutazione

Stack tecnologico
c, php
Ambito
backend
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
42/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.