Skip to content

Commit aa05670

Browse files
committed
Version 1.1.2
- Fixed "ternary operator" - Fixed bugs and code review (1.1.1 version) - Fixed bug in constants (1.1.0 version) - Improved examples
1 parent d13925a commit aa05670

File tree

8 files changed

+338
-266
lines changed

8 files changed

+338
-266
lines changed

CHANGELOG.md

Lines changed: 92 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -1,126 +1,139 @@
11
# Changelog
22

3+
## html2canvas-php-proxy 1.1.2
4+
5+
- Fixed "ternary operator"
6+
- Fixed bugs and code review (1.1.1 version)
7+
- Fixed bug in constants (1.1.0 version)
8+
9+
## html2canvas-php-proxy 1.0.0
10+
11+
- Change constant names
12+
- [Security] Setup allow domains and ports
13+
- Droped support for php4 (and who uses it?)
14+
- This version range (1.0.x) will not receive new features, only fixes, the next version will be available soon.
15+
316
## html2canvas-php-proxy 0.2.0
417

5-
* Support for html2canvas 0.5
18+
- Support for html2canvas 0.5
619

720
## html2canvas-php-proxy 0.1.14
821

9-
* Fixed bug if CURL is not avaliable
22+
- Fixed bug if CURL is not avaliable
1023

1124
## html2canvas-php-proxy 0.1.13
1225

13-
* Added support to CURL for improve usage in PHP 5.6
14-
* Organized functions
26+
- Added support to CURL for improve usage in PHP 5.6
27+
- Organized functions
1528

1629
## html2canvas-php-proxy 0.1.12
1730

18-
* Replace 0755 to 0666 permission for backup folder (`images/`)
31+
- Replace 0755 to 0666 permission for backup folder (`images/`)
1932

2033
## html2canvas-php-proxy 0.1.11
2134

22-
* Now using camelCase in functions
23-
* Fixed extension SVG in saved sources
35+
- Now using camelCase in functions
36+
- Fixed extension SVG in saved sources
2437

2538
## html2canvas-php-proxy 0.1.10
2639

27-
* Added support to data URI scheme
28-
* Added support to SVG images
29-
* Fixed BUG (Windows servers) with `dirname`, If the script was located in the root folder, the `dirname` function had an invalid character for additional urls generated by this script.
30-
* `json_encode_string` function now has a parameter that removes the quotes from the beginning and end of the string.
31-
* Extra in pullrequest: [pull/10](https://github.com/brcontainer/html2canvas-php-proxy/pull/10) - Thanks to [@jhewes](https://github.com/jhewes)
40+
- Added support to data URI scheme
41+
- Added support to SVG images
42+
- Fixed BUG (Windows servers) with `dirname`, If the script was located in the root folder, the `dirname` function had an invalid character for additional urls generated by this script.
43+
- `json_encode_string` function now has a parameter that removes the quotes from the beginning and end of the string.
44+
- Extra in pullrequest: [pull/10](https://github.com/brcontainer/html2canvas-php-proxy/pull/10) - Thanks to [@jhewes](https://github.com/jhewes)
3245

3346
## html2canvas-php-proxy 0.1.9
3447

35-
* Added support to "HTTP Basic access authentication"
48+
- Added support to "HTTP Basic access authentication"
3649

3750
## html2canvas-php-proxy 0.1.8
3851

39-
* Removed unused vars
40-
* Replace tabs by spaces (size 4)
41-
* Added `=== false` misses in `isset()`
42-
* Improved type
43-
* Removed `empty($maxExec)`
44-
* Removed unnecessary `=== true`
45-
* Replace `mkdir(PATH, 755)` to `mkdir(PATH, 0755)`
46-
* Added detect "SSL socket stream" support (If the socket requires "SSL", but do not have suporter then shows an error, but if you do not need to "SSL", even if it is not supported, then the code will work without showing error.)
47-
* Removed `?>` to prevent whitespace.
52+
- Removed unused vars
53+
- Replace tabs by spaces (size 4)
54+
- Added `=== false` misses in `isset()`
55+
- Improved type
56+
- Removed `empty($maxExec)`
57+
- Removed unnecessary `=== true`
58+
- Replace `mkdir(PATH, 755)` to `mkdir(PATH, 0755)`
59+
- Added detect "SSL socket stream" support (If the socket requires "SSL", but do not have suporter then shows an error, but if you do not need to "SSL", even if it is not supported, then the code will work without showing error.)
60+
- Removed `?>` to prevent whitespace.
4861

4962
## html2canvas-php-proxy 0.1.6 and 0.1.7 - 07.05.2014
5063

51-
* Changed order of functions
52-
* Removed `$e` variable (unused) in `json_encode`
53-
* Fixed line `$response = 'Failed to rename the temporary file';` (`$response` is array)
54-
* Removed incompatibility with PHP old versions (before 5.1.0) in `relative2absolute`
55-
* Added returns "blank" in `relative2absolute` (if `scheme` invalid in `$m` parameter)
56-
* Added detect problem in redirects (if you have multiple redirects)
57-
* Replace `stripos` by `strpos` (php4) - version 0.1.7
58-
* Added comparison of "socket time limit (timeout)" and "max_execution_time" (php.ini), preventing the page goes blank - version 0.1.7
59-
* Fixed urls like `//website.com/path/../file.png` to `http://website.com/file.png`
64+
- Changed order of functions
65+
- Removed `$e` variable (unused) in `json_encode`
66+
- Fixed line `$response = 'Failed to rename the temporary file';` (`$response` is array)
67+
- Removed incompatibility with PHP old versions (before 5.1.0) in `relative2absolute`
68+
- Added returns "blank" in `relative2absolute` (if `scheme` invalid in `$m` parameter)
69+
- Added detect problem in redirects (if you have multiple redirects)
70+
- Replace `stripos` by `strpos` (php4) - version 0.1.7
71+
- Added comparison of "socket time limit (timeout)" and "max_execution_time" (php.ini), preventing the page goes blank - version 0.1.7
72+
- Fixed urls like `//website.com/path/../file.png` to `http://website.com/file.png`
6073

6174
## html2canvas-php-proxy 0.1.5 - 04.05.2014
6275

63-
* Improved "typing" for better updates/pull-request
64-
* Converted various variables to (int)
65-
* Removed must-revalidate in header
66-
* Improved forks
67-
* Improved http response, If http_status<>200, return error in html2canvas
68-
* Fixed bug in Facebook redirect (HTTP/1.1 302 forced.302)
69-
* Removed unnecessary Etag-header
70-
* Fixed undefined variables
71-
* Fixed bug in `json_encode_string` (characters)
72-
* Fixed "invalid escapes" in `json_encode_string`
73-
* Improved performance in `json_encode_string`
74-
* Removed `utf8_encode` (unnecessary) in `json_encode_string`
75-
* Fixed bug in `relative2absolute`
76-
* `downloadSource` always returns array
77-
* Replace `error_get_last` by `get_error`
78-
* Added comments in functions
76+
- Improved "typing" for better updates/pull-request
77+
- Converted various variables to (int)
78+
- Removed must-revalidate in header
79+
- Improved forks
80+
- Improved http response, If http_status<>200, return error in html2canvas
81+
- Fixed bug in Facebook redirect (HTTP/1.1 302 forced.302)
82+
- Removed unnecessary Etag-header
83+
- Fixed undefined variables
84+
- Fixed bug in `json_encode_string` (characters)
85+
- Fixed "invalid escapes" in `json_encode_string`
86+
- Improved performance in `json_encode_string`
87+
- Removed `utf8_encode` (unnecessary) in `json_encode_string`
88+
- Fixed bug in `relative2absolute`
89+
- `downloadSource` always returns array
90+
- Replace `error_get_last` by `get_error`
91+
- Added comments in functions
7992

8093

8194
## html2canvas-php-proxy 0.1.2 to 0.1.4 - 17.03.2014
8295

83-
* Added support to javascript functions based in Objects (update to 0.1.2)
84-
* Fixed bug in 0.1.2 (update to 0.1.3)
85-
* Added support to "relative paths" (function relative2absolute) (0.1.4)
86-
* Added "referrer header" (if exists) (0.1.4)
87-
* Added "remove charset" for mime-types (eg. text/html; charset=ut8 => text/html) (0.1.4)
88-
* Added prefix in files created by html2canvas-php-proxy (0.1.4)
89-
* "remove_old_files function" removes only the files with prefix (0.1.4)
96+
- Added support to javascript functions based in Objects (update to 0.1.2)
97+
- Fixed bug in 0.1.2 (update to 0.1.3)
98+
- Added support to "relative paths" (function relative2absolute) (0.1.4)
99+
- Added "referrer header" (if exists) (0.1.4)
100+
- Added "remove charset" for mime-types (eg. text/html; charset=ut8 => text/html) (0.1.4)
101+
- Added prefix in files created by html2canvas-php-proxy (0.1.4)
102+
- "remove_old_files function" removes only the files with prefix (0.1.4)
90103

91104

92105
## html2canvas-php-proxy 0.1.1 - 01.12.2013
93106

94-
* Support for PHP 4.3
95-
* Replace `isset($vector['var']{0})` by `isset($vector['var']) && strlen($vector['var'])>0` to prevent the error `Uninitialized string offset: 0`
96-
* `MAX_EXEC` may not be less than 15 seconds
97-
* Add support to bitmap files
98-
* If the parameter "callback" has invalid characters then sets the variable `$param_callback` with `JSLOG`;
99-
* Detects if the "host:" header was set by the client
100-
* Remove port from `$_SERVER['HTTP_HOST']` to prevent problem in the formatting of the address
101-
* Add function for remove old files
102-
* Fixed "validate" callback param
107+
- Support for PHP 4.3
108+
- Replace `isset($vector['var']{0})` by `isset($vector['var']) && strlen($vector['var'])>0` to prevent the error `Uninitialized string offset: 0`
109+
- `MAX_EXEC` may not be less than 15 seconds
110+
- Add support to bitmap files
111+
- If the parameter "callback" has invalid characters then sets the variable `$param_callback` with `JSLOG`;
112+
- Detects if the "host:" header was set by the client
113+
- Remove port from `$_SERVER['HTTP_HOST']` to prevent problem in the formatting of the address
114+
- Add function for remove old files
115+
- Fixed "validate" callback param
103116

104117

105118
## html2canvas-php-proxy 0.1.0 - 24.11.2013
106119

107-
* Script completely rewritten
108-
* Added detection list "Content-length:" header
109-
* Added alternative to callback parameter (eg. The function call is `console.log` or `alert()`, if there is no callback parameter)
110-
* Added support for detecting max_execution_time
111-
* Added the use of `erro_get_last()`
112-
* Added support for "Location:" header
113-
* Added support for detecting 304 HTTP, return an error warning (socket does not use/send Etags)
114-
* Added `utf8_encode` to `json_encode` to prevent the error string becomes NULL
115-
* Added an error warning, if there is no the file "Content-type:" header
116-
* In case of HTTP 3xx response, if there is no "Location:" header, returns an error warning
117-
* Improved response headers from proxy (`function setHeaders`)
118-
* Improved validation http/https (`function isHttpUrl`)
119-
* Prevent warning in `rename()` (PHP 5.2 in CGI), because the warning `return false;`
120-
* In addition to other improvements when the script was rewritten
120+
- Script completely rewritten
121+
- Added detection list "Content-length:" header
122+
- Added alternative to callback parameter (eg. The function call is `console.log` or `alert()`, if there is no callback parameter)
123+
- Added support for detecting max_execution_time
124+
- Added the use of `erro_get_last()`
125+
- Added support for "Location:" header
126+
- Added support for detecting 304 HTTP, return an error warning (socket does not use/send Etags)
127+
- Added `utf8_encode` to `json_encode` to prevent the error string becomes NULL
128+
- Added an error warning, if there is no the file "Content-type:" header
129+
- In case of HTTP 3xx response, if there is no "Location:" header, returns an error warning
130+
- Improved response headers from proxy (`function setHeaders`)
131+
- Improved validation http/https (`function isHttpUrl`)
132+
- Prevent warning in `rename()` (PHP 5.2 in CGI), because the warning `return false;`
133+
- In addition to other improvements when the script was rewritten
121134

122135

123136
## html2canvas-php-proxy 0.0.4 - 20.11.2013
124137

125-
* Fixed tmp fileName $locationFile.$token
126-
* Use complete URI scheme for https
138+
- Fixed tmp fileName $locationFile.$token
139+
- Use complete URI scheme for https

README.html

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!DOCTYPE html><html><head><meta charset="utf-8"><style>body {
1+
<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><style>body {
22
max-width: 980px;
33
border: 1px solid #ddd;
44
outline: 1300px solid #fff;
@@ -841,7 +841,7 @@
841841
inset 0 -12px 0 rgba(0, 0, 0, .05);
842842
}
843843

844-
/* Multimarkdown Critic Blocks */
844+
/* MultiMarkdown Critic Blocks */
845845
.markdown-body .critic_mark {
846846
background: #ff0;
847847
}
@@ -992,7 +992,7 @@
992992
page-break-after: avoid;
993993
}
994994
}
995-
</style><style>/*github*/
995+
</style><style>/*GitHub*/
996996
.codehilite {background-color:#fff;color:#333333;}
997997
.codehilite .hll {background-color:#ffffcc;}
998998
.codehilite .c{color:#999988;font-style:italic}
@@ -1055,7 +1055,7 @@
10551055
.codehilite .vi{color:teal}
10561056
.codehilite .il{color:#009999}
10571057
.codehilite .gc{color:#999;background-color:#EAF2F5}
1058-
</style><title>README</title></head><body><article class="markdown-body"><h2 id="html2canvas-php-proxy-100">html2canvas-php-proxy 1.0.0<a class="headerlink" href="#html2canvas-php-proxy-100" title="Permanent link"></a></h2>
1058+
</style><title>README</title></head><body><article class="markdown-body"><h2 id="html2canvas-php-proxy">html2canvas-php-proxy<a class="headerlink" href="#html2canvas-php-proxy" title="Permanent link"></a></h2>
10591059
<h2 id="php-proxy-html2canvas">PHP Proxy html2canvas<a class="headerlink" href="#php-proxy-html2canvas" title="Permanent link"></a></h2>
10601060
<p>This script allows you to use <strong>html2canvas.js</strong> with different servers, ports and protocols (http, https),
10611061
preventing to occur &ldquo;tainted&rdquo; when exporting the <code>&lt;canvas&gt;</code> for image.</p>
@@ -1139,12 +1139,12 @@ <h2 id="setup">Setup<a class="headerlink" href="#setup" title="Permanent link">
11391139
<td>Set false for disable SSL checking or true for enable (require config PHP.INI with <code>curl.cainfo=/path/to/cacert.pem</code>). You can set path manualy like this: <code>define('H2CP_SSL_VERIFY_PEER', '/path/to/cacert.pem');</code></td>
11401140
</tr>
11411141
<tr>
1142-
<td><code>define('H2CP_ALLOWED_DOMAINS', array( '*' ));</code></td>
1143-
<td><code>*</code> allow all domains, for subdomains use like this <code>*.site.com</code>, for fixed domains use <code>array( 'site.com', 'www.site.com' )</code></td>
1142+
<td><code>define('H2CP_ALLOWED_DOMAINS', '*');</code></td>
1143+
<td><code>*</code> allow all domains, for subdomains use like this <code>*.site.com</code>, for fixed domains use <code>, 'site.com,www.site.com'</code> (<code>string</code> separed by commas)</td>
11441144
</tr>
11451145
<tr>
1146-
<td><code>define('H2CP_ALLOWED_PORTS', array( 80, 443 ));</code></td>
1147-
<td>Config allowed ports</td>
1146+
<td><code>define('H2CP_ALLOWED_PORTS', '80,443');</code></td>
1147+
<td>Config allowed ports (<code>string</code> separed by commas)</td>
11481148
</tr>
11491149
</tbody>
11501150
</table>
@@ -1201,12 +1201,12 @@ <h2 id="usage">Usage<a class="headerlink" href="#usage" title="Permanent link">
12011201

12021202
<h2 id="using-web-console">Using Web Console<a class="headerlink" href="#using-web-console" title="Permanent link"></a></h2>
12031203
<p>If you have any problems with the script recommend to analyze the log use the Web Console from your browser:
1204-
<em> Firefox: <a href="https://developer.mozilla.org/en-US/docs/Tools/Browser_Console">https://developer.mozilla.org/en-US/docs/Tools/Browser_Console</a>
1205-
</em> Chrome: <a href="https://developers.google.com/chrome-developer-tools/docs/console">https://developers.google.com/chrome-developer-tools/docs/console</a>
1204+
* Firefox: <a href="https://developer.mozilla.org/en-US/docs/Tools/Browser_Console">https://developer.mozilla.org/en-US/docs/Tools/Browser_Console</a>
1205+
* Chrome: <a href="https://developers.google.com/chrome-developer-tools/docs/console">https://developers.google.com/chrome-developer-tools/docs/console</a>
12061206
* InternetExplorer: <a href="http://msdn.microsoft.com/en-us/library/gg589530%28v=vs.85%29.aspx">http://msdn.microsoft.com/en-us/library/gg589530%28v=vs.85%29.aspx</a></p>
12071207
<p>Get NetWork results:
1208-
<em> Firefox: <a href="https://hacks.mozilla.org/2013/05/firefox-developer-tool-features-for-firefox-23/">https://hacks.mozilla.org/2013/05/firefox-developer-tool-features-for-firefox-23/</a>
1209-
</em> Chrome: <a href="https://developers.google.com/chrome-developer-tools/docs/network">https://developers.google.com/chrome-developer-tools/docs/network</a>
1208+
* Firefox: <a href="https://hacks.mozilla.org/2013/05/firefox-developer-tool-features-for-firefox-23/">https://hacks.mozilla.org/2013/05/firefox-developer-tool-features-for-firefox-23/</a>
1209+
* Chrome: <a href="https://developers.google.com/chrome-developer-tools/docs/network">https://developers.google.com/chrome-developer-tools/docs/network</a>
12101210
* InternetExplorer: <a href="http://msdn.microsoft.com/en-us/library/gg130952%28v=vs.85%29.aspx">http://msdn.microsoft.com/en-us/library/gg130952%28v=vs.85%29.aspx</a></p>
12111211
<p>An alternative is to diagnose problems accessing the link directly:</p>
12121212
<p><code>http://[DOMAIN]/[PATH]/html2canvasproxy.php?url=http%3A%2F%2Fmaps.googleapis.com%2Fmaps%2Fapi%2Fstaticmap%3Fcenter%3D40.714728%2C-73.998672%26zoom%3D12%26size%3D800x600%26maptype%3Droadmap%26sensor%3Dfalse%261&amp;callback=html2canvas_0</code></p>

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## html2canvas-php-proxy 1.0.0
1+
## html2canvas-php-proxy
22

33
## PHP Proxy html2canvas
44

0 commit comments

Comments
 (0)