Namespace restriction for source= queries is inert: smwAskParserFunction/smwShowParserFunction hooks do not exist
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 45/100
Direzione di ricerca
Inizia in src/HookRegistry.php e ispeziona gli handler registrati smwAskParserFunction e smwShowParserFunction. Verifica se un hook supportato di Semantic MediaWiki può ispezionare o sovrascrivere le chiamate #ask e #show, quindi esamina HookRegistryTest.php. Il lavoro è completato quando la restrizione del namespace funziona tramite un percorso supportato, oppure quando gli handler inattivi e la documentazione sono aggiornati, con copertura di regressione.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
HookRegistry registers handlers for two hook names — smwAskParserFunction and smwShowParserFunction — that do not exist in Semantic MediaWiki. As a result, the feature they implement (restricting source= queries to $seqlgExternalQueryEnabledNamespaces) never runs.
Details
src/HookRegistry.php registers a handler under both names:
$this->handlers['smwAskParserFunction'] = $this->handlers['smwShowParserFunction'] = static function ( $parser, $frame, $args, &$override ) {
// ... sets:
// $override = 'Warning: source parameter is not allowed in the namespace!'
// when the page's namespace is not in $GLOBALS['seqlgExternalQueryEnabledNamespaces']
};
This only does anything if Semantic MediaWiki fires hooks literally named smwAskParserFunction / smwShowParserFunction. Those names appear nowhere in the Semantic MediaWiki source tree, nor anywhere in its Git history, so the handlers are never invoked. The #ask / #show execution path (AskParserFunction / ShowParserFunction) does not run a hook of that name.
Impact
The $seqlgExternalQueryEnabledNamespaces namespace restriction is silently inert: a {{#ask: … |source=… }} (or {{#show:}}) query is not blocked in disallowed namespaces, contrary to what the setting documents.
This is pre-existing (identical on the current released code and on the SMW 7.0 branch) and was discovered during the SMW 7.0 migration (#44). The test suite does not catch it because HookRegistryTest only asserts the InterwikiLoadPrefix handler is registered, not that the ask/show guard fires.
Suggested next steps
- Confirm whether Semantic MediaWiki exposes an equivalent hook in a supported version that allows inspecting/overriding
#ask/#showparser-function invocations, and rewire the namespace guard to it; or - If no such hook exists, remove the dead handlers and either implement the namespace restriction by another mechanism or update the
$seqlgExternalQueryEnabledNamespacesdocumentation accordingly. - Add test coverage for whichever path is chosen so the guard cannot silently regress again.
- Lingua principale
- PHP
- Stelle
- 9
- Fork
- 8
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di SemanticMediaWiki/SemanticExternalQueryLookup
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
-
Not working with SMW 4.xAperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
-
bug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
SemanticMediaWiki/SemanticExternalQueryLookup#33 · 1 commento · 1 reazione ·
-
Use with private wikisApertaenhancement
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
SemanticMediaWiki/SemanticExternalQueryLookup#28 · 6 commenti ·
Tutte le issue di SemanticMediaWiki/SemanticExternalQueryLookup
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
components-web-app/api-components-bundle#403 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
mollie/PrestaShop#1566 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
components-web-app/docs#193 ·
-
Python 3.15 supportForse già presa @amnesiaof l’ha presa oggi. ApertaL: python L: python:uv
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
dependabot/dependabot-core#16524 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
crazy-goat/rabbit-stream#830 ·
I maintainer di solito rispondono entro 1 giorno