Skip to content

Commit

Permalink
escape apostrophes (') in strings.
Browse files Browse the repository at this point in the history
  • Loading branch information
Christopher A. Stelma committed Nov 10, 2015
1 parent da6a071 commit 3494d70
Show file tree
Hide file tree
Showing 17 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion library/Requests/Exception/Transport/cURL/Easy/1.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ class Requests_Exception_Transport_cURL_Easy_1 extends Requests_Exception_Transp
*
* @var string
*/
protected $reason = 'The URL you passed to libcurl used a protocol that this libcurl does not support. The support might be a compile-time option that you didn't use, it can be a misspelled protocol string or just a protocol libcurl has no code for.';
protected $reason = 'The URL you passed to libcurl used a protocol that this libcurl does not support. The support might be a compile-time option that you didn\'t use, it can be a misspelled protocol string or just a protocol libcurl has no code for.';
}
2 changes: 1 addition & 1 deletion library/Requests/Exception/Transport/cURL/Easy/18.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ class Requests_Exception_Transport_cURL_Easy_18 extends Requests_Exception_Trans
*
* @var string
*/
protected $reason = 'A file transfer was shorter or larger than expected. This happens when the server first reports an expected transfer size, and then delivers data that doesn't match the previously given size.';
protected $reason = 'A file transfer was shorter or larger than expected. This happens when the server first reports an expected transfer size, and then delivers data that doesn\'t match the previously given size.';
}
2 changes: 1 addition & 1 deletion library/Requests/Exception/Transport/cURL/Easy/19.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ class Requests_Exception_Transport_cURL_Easy_19 extends Requests_Exception_Trans
*
* @var string
*/
protected $reason = 'This was either a weird reply to a 'RETR' command or a zero byte transfer complete.';
protected $reason = 'This was either a weird reply to a \'RETR\' command or a zero byte transfer complete.';
}
2 changes: 1 addition & 1 deletion library/Requests/Exception/Transport/cURL/Easy/2.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ class Requests_Exception_Transport_cURL_Easy_2 extends Requests_Exception_Transp
*
* @var string
*/
protected $reason = 'Very early initialization code failed. This is likely to be an internal error or problem, or a resource problem where something fundamental couldn't get done at init time.';
protected $reason = 'Very early initialization code failed. This is likely to be an internal error or problem, or a resource problem where something fundamental couldn\'t get done at init time.';
}
2 changes: 1 addition & 1 deletion library/Requests/Exception/Transport/cURL/Easy/25.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ class Requests_Exception_Transport_cURL_Easy_25 extends Requests_Exception_Trans
*
* @var string
*/
protected $reason = 'Failed starting the upload. For FTP, the server typically denied the STOR command. The error buffer usually contains the server's explanation for this.';
protected $reason = 'Failed starting the upload. For FTP, the server typically denied the STOR command. The error buffer usually contains the server\'s explanation for this.';
}
2 changes: 1 addition & 1 deletion library/Requests/Exception/Transport/cURL/Easy/30.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ class Requests_Exception_Transport_cURL_Easy_30 extends Requests_Exception_Trans
*
* @var string
*/
protected $reason = 'The FTP PORT command returned error. This mostly happens when you haven't specified a good enough address for libcurl to use. See CURLOPT_FTPPORT.';
protected $reason = 'The FTP PORT command returned error. This mostly happens when you haven\'t specified a good enough address for libcurl to use. See CURLOPT_FTPPORT.';
}
2 changes: 1 addition & 1 deletion library/Requests/Exception/Transport/cURL/Easy/37.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ class Requests_Exception_Transport_cURL_Easy_37 extends Requests_Exception_Trans
*
* @var string
*/
protected $reason = 'A file given with FILE:// couldn't be opened. Most likely because the file path doesn't identify an existing file. Did you check file permissions?';
protected $reason = 'A file given with FILE:// couldn\'t be opened. Most likely because the file path doesn\'t identify an existing file. Did you check file permissions?';
}
2 changes: 1 addition & 1 deletion library/Requests/Exception/Transport/cURL/Easy/45.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ class Requests_Exception_Transport_cURL_Easy_45 extends Requests_Exception_Trans
*
* @var string
*/
protected $reason = 'Interface error. A specified outgoing interface could not be used. Set which interface to use for outgoing connections' source IP address with CURLOPT_INTERFACE.';
protected $reason = 'Interface error. A specified outgoing interface could not be used. Set which interface to use for outgoing connections\' source IP address with CURLOPT_INTERFACE.';
}
2 changes: 1 addition & 1 deletion library/Requests/Exception/Transport/cURL/Easy/5.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ class Requests_Exception_Transport_cURL_Easy_5 extends Requests_Exception_Transp
*
* @var string
*/
protected $reason = 'Couldn't resolve proxy. The given proxy host could not be resolved.';
protected $reason = 'Couldn\'t resolve proxy. The given proxy host could not be resolved.';
}
2 changes: 1 addition & 1 deletion library/Requests/Exception/Transport/cURL/Easy/51.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ class Requests_Exception_Transport_cURL_Easy_51 extends Requests_Exception_Trans
*
* @var string
*/
protected $reason = 'The remote server's SSL certificate or SSH md5 fingerprint was deemed not OK.';
protected $reason = 'The remote server\'s SSL certificate or SSH md5 fingerprint was deemed not OK.';
}
2 changes: 1 addition & 1 deletion library/Requests/Exception/Transport/cURL/Easy/53.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ class Requests_Exception_Transport_cURL_Easy_53 extends Requests_Exception_Trans
*
* @var string
*/
protected $reason = 'The specified crypto engine wasn't found.';
protected $reason = 'The specified crypto engine wasn\'t found.';
}
2 changes: 1 addition & 1 deletion library/Requests/Exception/Transport/cURL/Easy/59.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ class Requests_Exception_Transport_cURL_Easy_59 extends Requests_Exception_Trans
*
* @var string
*/
protected $reason = 'Couldn't use specified cipher.';
protected $reason = 'Couldn\'t use specified cipher.';
}
2 changes: 1 addition & 1 deletion library/Requests/Exception/Transport/cURL/Easy/6.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ class Requests_Exception_Transport_cURL_Easy_6 extends Requests_Exception_Transp
*
* @var string
*/
protected $reason = 'Couldn't resolve host. The given remote host was not resolved.';
protected $reason = 'Couldn\'t resolve host. The given remote host was not resolved.';
}
2 changes: 1 addition & 1 deletion library/Requests/Exception/Transport/cURL/Easy/81.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ class Requests_Exception_Transport_cURL_Easy_81 extends Requests_Exception_Trans
*
* @var string
*/
protected $reason = 'Socket is not ready for send/recv wait till it's ready and try again. This return code is only returned from curl_easy_recv and curl_easy_send (Added in 7.18.2)';
protected $reason = 'Socket is not ready for send/recv wait till it\'s ready and try again. This return code is only returned from curl_easy_recv and curl_easy_send (Added in 7.18.2)';
}
2 changes: 1 addition & 1 deletion library/Requests/Exception/Transport/cURL/Multi/2.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ class Requests_Exception_Transport_cURL_Multi_2 extends Requests_Exception_Trans
*
* @var string
*/
protected $reason = 'An easy handle was not good/valid. It could mean that it isn't an easy handle at all, or possibly that the handle already is in used by this or another multi handle.';
protected $reason = 'An easy handle was not good/valid. It could mean that it isn\'t an easy handle at all, or possibly that the handle already is in used by this or another multi handle.';
}
2 changes: 1 addition & 1 deletion library/Requests/Exception/Transport/cURL/Share/5.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ class Requests_Exception_Transport_cURL_Share_5 extends Requests_Exception_Trans
*
* @var string
*/
protected $reason = 'The requested sharing could not be done because the library you use don't have that particular feature enabled. (Added in 7.23.0)';
protected $reason = 'The requested sharing could not be done because the library you use don\'t have that particular feature enabled. (Added in 7.23.0)';
}
4 changes: 2 additions & 2 deletions library/Requests/Exception/generate_curl_exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class Requests_Exception_Transport_cURL_TYPE_CODE extends Requests_Exception_Tra
*
* @var string
*/
protected $reason = 'REASON';
protected $reason = 'REASON_ESCAPED';
}
'''

Expand All @@ -70,5 +70,5 @@ class Requests_Exception_Transport_cURL_TYPE_CODE extends Requests_Exception_Tra
if int(code) <= 0:
continue
with (p / t / (code + '.php')).open('wb') as f:
out = template.replace('CODE', code).replace('TYPE', t).replace('REASON', reason).replace('CONSTANT', constant)
out = template.replace('CODE', code).replace('TYPE', t).replace('REASON_ESCAPED', reason.encode('string-escape')).replace('REASON', reason).replace('CONSTANT', constant)
f.write(out)

0 comments on commit 3494d70

Please sign in to comment.