Jump to content

Ajuda:Títol incorrecte

From mediawiki.org
This page is a translated version of the page Help:Bad title and the translation is 71% complete.

Alguns títols de pàgina es defineixen com a incorrectes per diverses raons. No podeu crear pàgines amb aquests títols.

Per obtenir més informació sobre què constitueix un títol incorrecte, consulteu Manual:Títol de pàgina , la secció regex o Title.php .

Com a referència, aquí teniu un exemple d'un títol horrible però vàlid:

  • Some¬`!"£$^&*()_+-=~?/.,;:'@

Coses que no podeu utilitzar als títols:

Codis HTTP

Aquests varien segons el número de versió del programari:

  • 400 (Bad Request o Sol·licitud incorrecta) per a la versió 1.19.1 i superior
  • 200 (OK o vàlid) per a la versió 1.16.4 i anterior

Regex

Expressió regular PCRE2 relativament simple per a molts caràcters i seqüències no vàlids en títols. Tingueu en compte que això no recull tot el que podria estar malament amb els títols.

# Matching titles will be held as illegal.
$rxTc = '/' .
	# Any character not allowed is forbidden.
	'[^ %!"$&\'()*,\-.\/0-9:;=?@A-Z\\\\^_`a-z~\x80-\x{10FFFF}+]' .
	# Non-ASCII whitespace, Unicode bidi override characters, the replacement character and noncharacters.
	'|[\xA0\x{1680}\x{180E}\x{2000}-\x{200A}\x{200E}\x{200F}\x{2028}-\x{202F}\x{205F}\x{3000}\x{FFFD}\p{Noncharacter Code Point}]' .
	# Starting whitespace/colon or an empty title.
	'|\A(?:[ :]|\Z)' .
	# Double/closing whitespace.
	'| (?: |\Z)' .
	# URL percent encoding sequences interfere with the ability to round-trip titles, you can't link to them consistently.
	'|%[0-9A-Fa-f]{2}' .
	# XML/HTML character references produce similar issues.
	'|&[A-Za-z0-9\x80-\x{10FFFF}]+;' .
	# Pages with "/./" or "/../" appearing in the URLs will often be unreachable due to the way web browsers deal with 'relative' URLs. Also, they conflict with subpage syntax. Forbid them explicitly.
	'|(?:\A|\/)\.\.?(?:\/|\Z)' .
	# Magic tilde sequences.
	'|~{3}' .
	'/u';

See also