Disable wporg updates for premium products.

@param string $r Update payload.
@param string $url The api url.

@return mixed List of themes to check for update.
518688
function disable_wporg_update( $r, $url ) {

		if ( 0 !== strpos( $url, 'https://api.wordpress.org/themes/update-check/' ) ) {
			return $r;
		}

		// Decode the JSON response.
		$themes = json_decode( $r['body']['themes'] );

		unset( $themes->themes->{$this->product->get_slug()} );

		// Encode the updated JSON response.
		$r['body']['themes'] = json_encode( $themes );

		return $r;
	}
815999
private function _onDisabled($url,$options ){
		$onDisabled = $options['onDisabled'];
		unset($options['onDisabled']);
		
		
		if ($onDisabled === true) {
			$url = false;
			$options = $this->addClass($options,'disabled');
			$exit = true;
		}
	
		return array($url, $options);	
	}
272802
public function URLToTable($url, GrabzItTableOptions $options = null)
	{
		if ($options == null)
		{
			$options = new GrabzItTableOptions();			
		}		

		$this->request = new GrabzItRequest($this->getRootUrl(false) . GrabzItClient::TakeTable, false, $options, $url);
	}
674495
public static function fixUri($url) {
        $url = preg_replace('#/+|\\\+#', '/', $url);

        if ($url[0] == '/') {
            $url = substr($url, 1, strlen($url));
        } if (substr($url, -1) == '/') {
            $url = substr($url, 0, strlen($url) - 1);
        }

        return $url;
    }
269184
static function removeURLlinkList( $contentObjectAttributeID, $contentObjectAttributeVersion )
    {
        $conditions = array( 'contentobject_attribute_id' => $contentObjectAttributeID );
        if ( $contentObjectAttributeVersion !== false )
            $conditions['contentobject_attribute_version'] = $contentObjectAttributeVersion;
        eZPersistentObject::removeObject( eZURLObjectLink::definition(),
                                          $conditions );
    }
173435
private function _onHide($url,$options,$exit = false ){
		$onHide = $options['onHide'];
		unset($options['onHide']);
		
		
		if ($onHide === true) {
			$exit = true;
		}
		
		return array($url, $options, $exit);	
	}
685530
public function dontSeeLink($text, $url = null)
    {
        return $this->assertInPage(new HasLink($text, $url), true);
    }
470728
private function _uploadAssetFileFromResource($url, $resource)
    {
        $blockSize = self::MAX_BLOCK_SIZE;
        $blockIds = [];

        $blockContent = fread($resource, $blockSize);
        if (feof($resource)) {
            $this->_uploadAssetFileSingle($url, $blockContent);

            return;
        }

        $blockId = $this->_generateBlockId(count($blockIds));

        $blockIds[] = $blockId;
        $this->_uploadBlock($url, $blockId, $blockContent);

        while (!feof($resource)) {
            $blockContent = fread($resource, $blockSize);

            $blockId = $this->_generateBlockId(count($blockIds));

            $blockIds[] = $blockId;
            $this->_uploadBlock($url, $blockId, $blockContent);
        }

        $this->_commitBlocks($url, $blockIds);
    }
26403
private static function setRoot($url)
    {
        $segements = explode('/', $url);
        $count = count($segements) - 2;

        $path = '';

        for ($i = 0; $i < $count; $i++) {
            $path .= '../';
        }

        Application::$path .= $path;

        return Application::$path;
    }
455951
public function removeComposerPatch($package, $url) {
    $composer_json = $this->getComposerJson();
    if (!empty($composer_json['extra']['patches'][$package])) {
      foreach ($composer_json['extra']['patches'][$package] as $key => $patch_url) {
        if ($patch_url == $url) {
          unset($composer_json['extra']['patches'][$package][$key]);
          // If that was the only patch for this module, unset the parent too.
          if (empty($composer_json['extra']['patches'][$package])) {
            unset($composer_json['extra']['patches'][$package]);
          }
          $this->writeComposerJson($composer_json);

          return TRUE;
        }
      }
    }
    return FALSE;
  }
623658
function delete($r, $param)
    {
        $this->setUp($param);

        if (isset($_POST['file'])) {
            $file = _WWW.$this->articlePatch.basename(rawurldecode($_POST['file']));
            $mini = _WWW.$this->articlePatch.'mini_'.basename(rawurldecode($_POST['file']));

            if (file_exists($file)) {
                unlink($file);
            }
            if (file_exists($mini)) {
                unlink($mini);
            }
        }
    }
1215550
public function ping($url): void
    {
        $context = \stream_context_create(
            [
                'http' => [
                    'user_agent' => 'Crunz StreamHttpClient',
                    'timeout' => 5,
                ],
            ]
        );
        $resource = @\fopen(
            $url,
            'rb',
            false,
            $context
        );

        if (false === $resource) {
            $error = \error_get_last();
            $errorMessage = $error['message'] ?? 'Unknown error';

            throw new HttpClientException("Ping failed with message: \"{$errorMessage}\".");
        }

        \fclose($resource);
    }
810433
public function purge($url)
    {
        $http = preg_replace('#^https:#', 'http:', $url);
        $https = preg_replace('#^http:#', 'https:', $url);

        $purgedHttp = $this->doPurge($http);
        $purgedHttps = $this->doPurge($https);

        return $purgedHttp || $purgedHttps;
    }
293090
public function updateURL(&$url)
    {
        // Skip if resampling is off, or is already resampled, or is not an image
        if (!Config::inst()->get(get_class($this), 'force_resample') || $this->getVariant() || !$this->getIsImage()) {
            return;
        }

        // Attempt to resample
        $resampled = $this->Resampled();
        if (!$resampled) {
            return;
        }

        // Only update if resampled file is a smaller file size
        if ($resampled->getAbsoluteSize() < $this->getAbsoluteSize()) {
            $url = $resampled->getURL();
        }
    }
539197
protected function getGuzzleResponse(Url $url, array $options = [])
    {
        if (version_compare(Client::VERSION, '6.0.0', '<')) {
            /** @deprecated Deprecated since 3.0, to be removed in 4.0. */
            $options['allow_redirects'] = [
                'max' => 10,
            ];
            $response = $this->client->get((string) $url, $options);
            $redirectUri = $response->getEffectiveUrl() ?: (string) $url;
        } else {
            $allowRedirects = $this->client->getConfig('allow_redirects');
            $allowRedirects['max'] = 10;
            $allowRedirects['track_redirects'] = true;
            $options['allow_redirects'] = $allowRedirects;

            $uri = new Psr7\Uri((string) $url);
            $request = new Psr7\Request('GET', $uri, ['Accept' => 'text/html']);
            /** @var Psr7\Response $response */
            $response = $this->client->send($request, $options);
            $redirectUriHistory = $response->getHeader('X-Guzzle-Redirect-History');
            $redirectUri = $redirectUriHistory ? array_pop($redirectUriHistory) : (string) $url;
        }

        return [
            'url'         => $redirectUri,
            'statusCode'  => $response->getStatusCode(),
            'contentType' => $this->getMimeType($response),
            'content'     => $response->getBody()->getContents(),
            'headers'     => $response->getHeaders(),
            'info'        => [],
        ];
    }
981034
protected function urlParts(string $url)
    {
        if (false === filter_var($url, FILTER_VALIDATE_URL, FILTER_FLAG_PATH_REQUIRED)) {
            return false;
        }
        return parse_url($url) ?: false;
    }
458164
public static function sanitizeUrl(string $url) : string
    {
        $url_no_protocol = $url;
        if (stristr($url, "https://")) {
            $tmp             = explode("https://", $url);
            $url_no_protocol = $tmp[1];
        } else {
            if (stristr($url, "http://")) {
                $tmp             = explode("http://", $url);
                $url_no_protocol = $tmp[1];
            }
        }

        if ($url_no_protocol == '') {
            return '';
        }

        return rtrim($url_no_protocol, '/');
    }