예제 #1
0
 private function _genRemoveLinkList($links)
 {
     if (preg_match_all('/(?:https?\\:\\/\\/)?' . preg_quote(preg_replace('/^https?\\:\\/\\//i', '', trim(URL_BASE, ' /')), '/') . '\\/![\\da-z_,-\\/]+?![\\da-f\\/]+?(?=https?\\:\\/\\/|' . preg_quote(preg_replace('/^https?\\:\\/\\//i', '', trim(URL_BASE, ' /')), '/') . '|[^\\da-z_,-\\/]|$)/i', $links, $match) > 0) {
         $links_to_be_removed = [];
         foreach ($match[0] as $mc_link) {
             list(, $mc_link_id, ) = explode('!', $mc_link);
             $id = str_replace('/', '', $mc_link_id);
             if (!Utils_MegaCrypter::isBlacklistedLink($id)) {
                 try {
                     $links_to_be_removed[$mc_link] = Utils_MegaCrypter::decryptLink($mc_link);
                 } catch (Exception_MegaCrypterLinkException $exception) {
                 }
             }
         }
     }
     return $links_to_be_removed;
 }