Ejemplo n.º 1
0
 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);
 }
Ejemplo n.º 2
0
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);
}
Ejemplo n.º 3
0
 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');
 }
Ejemplo n.º 4
0
 /**
  * プロフィールのリンクを生成
  * @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);
 }
Ejemplo n.º 5
0
 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);
 }