Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
mediawiki-title
Advanced tools
Mediawiki title normalizetion, that conforms to the normalization rules used in MediaWiki Core. In general, the page title is converted to the mediawiki DB key format by trimming spaces, replacing whitespace symbols to underscores and applying wiki-specific capitalizetion rules. The namespace name is converted to a localized canonical name.
Object
Information about a wikimedia site required to make correct normalization.
Kind: global class
boolean
boolean
boolean
boolean
boolean
string
Namespace
| undefined
Namespace
Represents a wiki namespace
Param | Type | Description |
---|---|---|
id | number | The namespace identifier |
siteInfo | SiteInfo | The site metadata information. |
boolean
Checks whether namespace is Special
.
Kind: instance method of Namespace
boolean
Checks whether namespace is Main
.
Kind: instance method of Namespace
boolean
Checks whether namespace is Talk
.
Kind: instance method of Namespace
boolean
Checks whether namespace is User
.
Kind: instance method of Namespace
boolean
Checks whether namespace is User_Talk
.
Kind: instance method of Namespace
string
Get the canonical name string for this namespace.
Kind: instance method of Namespace
Namespace
| undefined
Creates a namespace instance from namespace text or a namespace alias
Kind: static method of Namespace
Returns: Namespace
| undefined
- a namespace or undefined if it wasn't found.
Param | Type | Description |
---|---|---|
text | string | Namespace name text. |
siteInfo | SiteInfo | the site information. |
Namespace
Creates a namespace object for a Main
namespace.
Kind: static method of Namespace
Param | Type | Description |
---|---|---|
siteInfo | SiteInfo | the site information. |
Kind: global class
string
Namespace
Creates a new title object with article the dbKey and namespace
Param | Type | Description |
---|---|---|
key | string | The article title in a form of the dbKey. |
namespace | Namespace | number | The article namespace. |
siteInfo | SiteInfo | The site metadata. |
[fragment] | string | The fragment of the title. |
string
Returns the normalized article title and namespace.
Kind: instance method of Title
Namespace
Returns the namespace of an article.
Kind: instance method of Title
Title
Normalize a title according to the rules of
Kind: static method of Title
Returns: Title
- The resulting title object.
Param | Type | Description |
---|---|---|
title | string | The page title to normalize. |
siteInfo | SiteInfo | The site information. |
Object
Information about a wikimedia site required to make correct normalization.
Kind: global typedef
Properties
Name | Type | Description |
---|---|---|
lang | string | Site language code. |
legaltitlechars | string | A perl-like regex for characters allowed in the page title. |
case | string | Whether to capitalize the first letter of the title. Could be obtained from the general section of the siteInfo php API response. |
namespaces | Object | Site namespaces info in the same format as returned by PHP api. |
namespacealiases | Object | Site namespace aliases in the same format as returned by PHP api. |
The library returns a Bluebird promise of a normalized title.
Wiki-specific rules are fetched from the api, and
cached within the Normalizer
instance, so reusing the instance is highly recommended.
var result = Title.fromPrefixedText('some_title', {
lang: 'en',
legaltitlechars: " %!\"$&'()*,\\-.\\/0-9:;=?@A-Z\\\\^_`a-z~\\x80-\\xFF+",
namespaces: {
"0": {
id: 0,
case: "first-letter",
content: "",
"*": ""
},
}
});
console.log(result.getPrefixedDBKey());
For bug reporting please use Phabricator ]
and mark the bugs with Servises
label or contuct directly in IRC in the #wikimedia-services channel.
FAQs
Title normalization library for mediawiki
The npm package mediawiki-title receives a total of 5,926 weekly downloads. As such, mediawiki-title popularity was classified as popular.
We found that mediawiki-title demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 6 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.