if(strcmp(substr($url,0,7), 'http://') != 0 && strcmp(substr($url,0,8), 'https://') != 0){ $url = 'http://'.$url; } $url = parse_url($url); if(!isset($url['scheme']) || !isset($url['host']) || !isset($url['path'])){ OC_ocDownloaderPB::setError($l->t('Connection error ...')); }else{ $path = $url['path']; $url = $url['scheme'].'://'.$url['host'].(isset($url['port'])?':'.$url['port']:'').$url['path']; if(!preg_match('/^pr_([0-9]{1,4})$/', $pr, $m)){ OC_ocDownloaderPB::setError($l->t('Unknown error')); }else{ $user_info = OC_ocDownloader::getUserProviderInfo($m[1]); if(!preg_match('/^(http|https):\/\/rapidshare.com\/files\/(.*)\/(.+)$/', $url, $m)){ OC_ocDownloaderPB::setError($l->t('This file does not exists')); }else{ if(!is_numeric($m[2])){ OC_ocDownloaderPB::setError($l->t('Wrong File iD')); }else{ $pr_url = 'https://api.rapidshare.com/cgi-bin/rsapi.cgi?sub=download&bin=1'; if(isset($user_info['us_username']) && isset($user_info['us_password'])){ $pr_url .= '&login='******'us_username'].'&password='******'us_password']; } $pr_url .= '&fileid='.$m[2].'&filename='.$m[3]; $curl = OC_ocDownloaderHTTP::execURL($pr_url, 'rapidshare'); if(strlen($curl) == 0){