private function getResources($url, $html = '') { if (empty($html)) { $response_data = apiModel::getRequestInfo($url); $html = $response_data['html']; } if ($html) { $resources = $this->collectResources($html); for ($i = 0; $i < count($resources); $i++) { if (preg_match('/^\\/\\/[^\\.]+\\..+/', $resources[$i])) { $resources[$i] = 'http:' . $resources[$i]; } if (!preg_match('/^http:\\/\\/[^\\/]+\\/.+/', $resources[$i])) { preg_match('/^(https{0,1}:\\/\\/[^\\/]+\\/{0,1}[^\\?]*)/', $url, $mch); $resources[$i] = preg_replace('/(?<!:)\\/\\//', '/', $mch[1] . '/' . $resources[$i]); } } return $resources; } else { apiModel::$errors[] = __METHOD__ . ': no html.'; } return false; }