예제 #1
0
 function setParam($page, $name, $body, $type = '', $alias = '')
 {
     static $converter = NULL;
     $this->page = $page;
     $this->name = $name;
     $this->body = $body;
     $this->type = $type;
     if (!PKWK_DISABLE_INLINE_IMAGE_FROM_URI && is_url($alias) && preg_match('/\\.(gif|png|jpe?g)$/i', $alias)) {
         $alias = '<img src="' . htmlspecialchars($alias) . '" alt="' . $name . '" />';
     } else {
         if ($alias != '') {
             if ($converter === NULL) {
                 $converter = new InlineConverter(array('plugin'));
             }
             $alias = make_line_rules($converter->convert($alias, $page));
             // BugTrack/669: A hack removing anchor tags added by AutoLink
             $alias = preg_replace('#</?a[^>]*>#i', '', $alias);
         }
     }
     $this->alias = $alias;
     return TRUE;
 }
예제 #2
0
	function setParam($page,$name,$type='',$alias='')
	{
		static $converter = NULL;
		
		$this->page = $page;
		$this->name = $name;
		$this->type = $type;
		if ($type != 'InterWikiName' and preg_match('/\.(gif|png|jpe?g)$/i',$alias))
		{
			$alias = htmlspecialchars($alias);
			$alias = "<img src=\"$alias\" alt=\"$name\" />";
		}
		else if ($alias != '')
		{
			if ($converter === NULL)
			{
				$converter = new InlineConverter(array('plugin'));
			}
			$alias = make_line_rules($converter->convert($alias,$page));
		}
		$this->alias = $alias;
		
		return TRUE;
	}