You are here

public function ShareaholicShareCount::is_url_encoded in Share Buttons, Related Posts, Content Analytics - Shareaholic 7.3

Same name and namespace in other branches
  1. 8 lib/social-share-counts/share_count.php \ShareaholicShareCount::is_url_encoded()

Check if the url is encoded

The check is very simple and will fail if the url is encoded more than once because the check only decodes once

Parameters

string $url the url to check if it is encoded:

Return value

boolean true if the url is encoded and false otherwise

1 call to ShareaholicShareCount::is_url_encoded()
ShareaholicShareCount::__construct in lib/social-share-counts/share_count.php

File

lib/social-share-counts/share_count.php, line 102

Class

ShareaholicShareCount
An abstract class Share Counts to be extended

Code

public function is_url_encoded($url) {
  $decoded = urldecode($url);
  if (strcmp($url, $decoded) === 0) {
    return false;
  }
  return true;
}