should i escape the parameters for the AddAddress function in PHPMailer? - phpmailer

Is there a need to escape the parameters in the "addaddress"-function in phpmailer using htmlentities ? the $email and the $name i mean, or is this done by phpmailer itself ?

No. Email names have nothing to do with HTML. Just pass plain strings. If you need particular characters, use a character set that has them, such as UTF-8:
$mail->CharSet = 'UTF-8';

Related

encode variables with special characters for azure

Very Similar problem to AADSTS50012: Invalid client secret is provided when moving from a Test App to Production
The top answer says to Encode your secret e.g. replace + by %2B and = by %3D, etc how would I replace the special character Tilde ~
As Suggested by juunas, and as per the document yes, you can replace the special character.
URL encoding converts characters into a format that can be transmitted over the Internet.
Here is the link for complete information regarding Encoding Techniques.

How to pass special characters and digits in cucumber data table

In cucumber feature file, am trying to send username and password. password is a mix of specialcharacters, digits and alphabet like
"Password#2"
. I tried escaping with slashes like
"Password/#2", "Password\#2" , "Password/#/2"
and double slashes as well but not successful. How can we pass such special characters in cucumber feature file.
Thanks in Advance.

How to contact emoji with string

Im having trouble concatenating these Unicode emojis with strings in Python3 (to send in Pushwoosh notifications).
Im defining emojis as Unicode variables:
stick_out_tongue = u'U+1F61C'
And then concatenating the string as such:
message = ' Message here...'
message = stick_out_tongue + message
But the output looks turns out like :
'U+1F61C Message here...'
Plz hlp.
Like #lenz said, you are probably looking for "\U0001f61c." That is a specific unicode character code. When you write "u'U+1F61C'" it simply takes the text "U+1F61C" and encodes it in unicode characters. You specify a unicode character code (as apposed to unicode text) by using a "\U." See this tutorial for more information.

Azure CosmosDB: illegal characters in Document Id

I have the issue that the Ids that are being generated based on certain input contain the character "/". This leads to an error during the Upsert operation as "/" is not allowed in the Document id.
Which characters are not allowed beside that?
What are ways to handle such a situation?
The illegal characters are /, \\, ?, # (see https://learn.microsoft.com/en-us/dotnet/api/microsoft.azure.documents.resource.id?view=azure-dotnet)
Ways to deal with such a situation:
Remove the character already in the input used for generating the id
Replace the character in the id with another character / set of characters
Use Hashing / Encoding (e.g. Base64)
If you know a better way please share. Thanks
I'm base64 encoding the plaintext. Then replacing the '/' and '=' that can still be there from base64 with '-' and '_' respectively. This seems to be working well. I ran into other issues when I just tried UrlEncode the value.
Psuedo:
var encoded = String.ConvertToBase64(plainTextId);
var preppedId = encoded.Replace('/','-').Replace('=','_');

Groovy JMeter Passing a string with spaces, avoiding %20

I have an API which it's URL requires a string with spaces --> A B C
I have tried
String X = "A B C";
vars.put("myKey",X);
GET https://myserver.com/Api/v1.0/config/${myKey}
When JMeter executes this it replaces spaces with %20 in url. I do not want JMeter to repalces spaces with %20, how can I do that
GET https://myserver.com/Api/v1.0/config/A%20B%20C
You can't send space in URL:
A URL must not contain a literal space. It must either be encoded using the percent-encoding or a different encoding that uses URL-safe characters (like application/x-www-form-urlencoded that uses + instead of %20 for spaces).
But you can use + instead of space
And notice that server/receiving end will decode it back to spaces so there isn't a real issue.
Usually browser replaces spaces entered into the address bar with %20. So do JMeter.
You have to update your API, so URL param with %20 should be interpreted as a string with a space(s) by your API.

Resources