},
whatsApp: {
link: elBySel('.jsShareWhatsApp', container),
- share: (function() {
+ share: (function(event) {
+ event.preventDefault();
- window.location.href = 'whatsapp://send?text=' + this._pageDescription + '%20' + pageUrl;
+ window.location.href = 'https://api.whatsapp.com/send?text=' + this._pageDescription + '%20' + this._pageUrl;
}).bind(this)
}
};
/** @var \DOMElement $element */
foreach ($elements as $element) {
$itemName = $element->getAttribute('name');
+
+ // Safeguard against malformed phrases, an empty name has a strange side effect.
+ if (empty($itemName)) {
+ throw new \InvalidArgumentException("The name attribute is missing or empty.");
+ }
+
+ if ($itemName !== $categoryName && strpos($itemName, $categoryName . '.') !== 0) {
+ throw new \InvalidArgumentException(WCF::getLanguage()->getDynamicVariable(
+ 'wcf.acp.language.import.error.categoryMismatch',
+ [
+ 'categoryName' => $categoryName,
+ 'languageItem' => $itemName
+ ]
+ ));
+ }
+
$itemValue = $element->nodeValue;
$itemData[] = $this->languageID;