Jump to content

Hjälp:Felaktig titel

From mediawiki.org
This page is a translated version of the page Help:Bad title and the translation is 71% complete.
Outdated translations are marked like this.
PD OBS: När du redigerar denna sida samtycker du till att släppa ditt bidrag under CC0. Se hjälpsidorna för Public Domain för mer information. PD

Vissa sidtitlar definieras som felaktiga av olika anledningar. Du kan inte skapa sidor med en sån titel.

För detaljer om vad som definieras som felaktigt, läs avsnittet regex eller Title.php .

Här har vi till exempel en avskyvärd, men giltig titel:

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

Saker man inte kan använda i en titel:

HTTP-koder

Dessa skiljer sig åt beroende på programvarans versionsnummer:

  • 400 (felaktig begäran) för v1.19.1 eller senare
  • 200 (OK) för v1.16.4 eller tidigare

Regex

Relatively simple PCRE2 regex for many invalid characters and sequences in titles. Note that this does not pick up everything that could be wrong with titles.

# Matchande titlar kommer hållas som ogiltiga.
$rxTc = '/' .
	# Alla tecken som otillåtna tecken är förbjudna.
	'[^ %!"$&\'()*,\-.\/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';

Se även