You are here

protected function OAuthStorePostgreSQL::sql_escape_string in Lingotek Translation 7.7

Same name and namespace in other branches
  1. 7.2 lib/oauth-php/library/store/OAuthStorePostgreSQL.php \OAuthStorePostgreSQL::sql_escape_string()
  2. 7.3 lib/oauth-php/library/store/OAuthStorePostgreSQL.php \OAuthStorePostgreSQL::sql_escape_string()
  3. 7.4 lib/oauth-php/library/store/OAuthStorePostgreSQL.php \OAuthStorePostgreSQL::sql_escape_string()
  4. 7.5 lib/oauth-php/library/store/OAuthStorePostgreSQL.php \OAuthStorePostgreSQL::sql_escape_string()
  5. 7.6 lib/oauth-php/library/store/OAuthStorePostgreSQL.php \OAuthStorePostgreSQL::sql_escape_string()

File

lib/oauth-php/library/store/OAuthStorePostgreSQL.php, line 1928

Class

OAuthStorePostgreSQL

Code

protected function sql_escape_string($s) {
  if (is_string($s)) {
    return pg_escape_string($this->conn, $s);
  }
  else {
    if (is_null($s)) {
      return NULL;
    }
    else {
      if (is_bool($s)) {
        return intval($s);
      }
      else {
        if (is_int($s) || is_float($s)) {
          return $s;
        }
        else {
          return pg_escape_string($this->conn, strval($s));
        }
      }
    }
  }
}