public function __toString() { global $nofollow; $rel = 'external' . ($nofollow === TRUE) ? ' nofollow' : ''; $target = empty($this->redirect) ? $this->name : $this->redirect . rawurlencode($this->name); $purl = parse_url($target); if (isset($purl['host']) && extension_loaded('intl')) { // Fix punycode URL $url = preg_replace('/' . $purl['host'] . '/', idn_to_ascii($purl['host']), $target); } else { $url = $target; } return parent::setLink($this->alias, $url, $this->name, $rel); }
function plugin_redirect_convert() { $argv = func_get_args(); $argc = func_num_args(); $field = array('caption', 'url', 'img'); for ($i = 0; $i < $argc; $i++) { ${$field}[$i] = Utility::htmlsc($argv[$i], ENT_QUOTES); } if (empty($url)) { return 'usage: #redirect(caption, url, img)'; } if (empty($caption)) { $caption = 'no title'; } if (!empty($img)) { $caption = '<img src="' . $img . '" alt="' . $caption . '" title="' . $caption . '" />'; } return Inline::setLink($caption, $url, null, 'noreferer', true); }
public function __toString() { global $nofollow; $target = empty($this->redirect) ? $this->name : $this->redirect . rawurlencode($this->name); return parent::setLink($this->alias, $target, $this->name, $nofollow === FALSE ? null : 'nofollow'); }
/** * プロフィールのリンクを生成 * @return string */ function get_profile_link() { $message = $this->getSession(); if (empty($message['name'])) { return ''; } return Inline::setLink($message['name'], self::hatena_profile_url($message['name']), '', 'nofollow', false); }
function get_profile_link() { $message = $this->getSession(); if (!empty($message['api']) && $this->auth_name !== $message['api']) { return false; } if (empty($message['nick'])) { return ''; } return Inline::setLink($message['name'], self::typekey_profile_url($message['name']), '', 'nofollow', false); }