예제 #1
0
파일: Key.php 프로젝트: HaldunA/phpwebsite
 public function setUrl($url, $local = true)
 {
     if (preg_match('/^<a/', trim($url))) {
         $url = preg_replace('/<a href="(.*)".*<\\/a>/iU', '\\1', $url);
     }
     if ($local) {
         PHPWS_Text::makeRelative($url, false);
     }
     $this->url = str_replace('&amp;', '&', trim($url));
     $this->url = preg_replace('/&?authkey=\\w{32}/', '', $this->url);
 }
예제 #2
0
 public function setUrl($url)
 {
     if (!preg_match('/^(\\.\\/|index.php)/i', $url) && preg_match('/\\w+\\.\\w{2,3}($|\\/)/', $url)) {
         $url = PHPWS_Text::checkLink($url);
     }
     PHPWS_Text::makeRelative($url);
     $url = str_replace('&amp;', '&', trim($url));
     $this->url = preg_replace('/&?authkey=\\w{32}/i', '', $url);
 }
예제 #3
0
 public static function parseInput($text, $encode = ENCODE_PARSED_TEXT, $relative_links = MAKE_ADDRESSES_RELATIVE)
 {
     // Moved over from getPrint/parseOutput
     if ((bool) $relative_links) {
         PHPWS_Text::makeRelative($text, true, true);
     }
     if ($encode) {
         if (function_exists('iconv')) {
             $text = iconv('utf-8', 'utf-8', $text);
         } else {
             $text_tmp = utf8_encode($text);
             if (!empty($text_tmp)) {
                 $text = $text_tmp;
             }
         }
         $text = htmlentities($text, ENT_QUOTES, 'UTF-8');
     }
     return trim($text);
 }