Skip to content

Commit

Permalink
Version 1.1.2
Browse files Browse the repository at this point in the history
- Fixed "ternary operator"
- Fixed bugs and code review (1.1.1 version)
- Fixed bug in constants (1.1.0 version)
- Improved examples
  • Loading branch information
brcontainer committed Jan 6, 2019
1 parent d13925a commit aa05670
Show file tree
Hide file tree
Showing 8 changed files with 338 additions and 266 deletions.
171 changes: 92 additions & 79 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,126 +1,139 @@
# Changelog

## html2canvas-php-proxy 1.1.2

- Fixed "ternary operator"
- Fixed bugs and code review (1.1.1 version)
- Fixed bug in constants (1.1.0 version)

## html2canvas-php-proxy 1.0.0

- Change constant names
- [Security] Setup allow domains and ports
- Droped support for php4 (and who uses it?)
- This version range (1.0.x) will not receive new features, only fixes, the next version will be available soon.

## html2canvas-php-proxy 0.2.0

* Support for html2canvas 0.5
- Support for html2canvas 0.5

## html2canvas-php-proxy 0.1.14

* Fixed bug if CURL is not avaliable
- Fixed bug if CURL is not avaliable

## html2canvas-php-proxy 0.1.13

* Added support to CURL for improve usage in PHP 5.6
* Organized functions
- Added support to CURL for improve usage in PHP 5.6
- Organized functions

## html2canvas-php-proxy 0.1.12

* Replace 0755 to 0666 permission for backup folder (`images/`)
- Replace 0755 to 0666 permission for backup folder (`images/`)

## html2canvas-php-proxy 0.1.11

* Now using camelCase in functions
* Fixed extension SVG in saved sources
- Now using camelCase in functions
- Fixed extension SVG in saved sources

## html2canvas-php-proxy 0.1.10

* Added support to data URI scheme
* Added support to SVG images
* 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.
* `json_encode_string` function now has a parameter that removes the quotes from the beginning and end of the string.
* Extra in pullrequest: [pull/10](https://github.com/brcontainer/html2canvas-php-proxy/pull/10) - Thanks to [@jhewes](https://github.com/jhewes)
- Added support to data URI scheme
- Added support to SVG images
- 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.
- `json_encode_string` function now has a parameter that removes the quotes from the beginning and end of the string.
- Extra in pullrequest: [pull/10](https://github.com/brcontainer/html2canvas-php-proxy/pull/10) - Thanks to [@jhewes](https://github.com/jhewes)

## html2canvas-php-proxy 0.1.9

* Added support to "HTTP Basic access authentication"
- Added support to "HTTP Basic access authentication"

## html2canvas-php-proxy 0.1.8

* Removed unused vars
* Replace tabs by spaces (size 4)
* Added `=== false` misses in `isset()`
* Improved type
* Removed `empty($maxExec)`
* Removed unnecessary `=== true`
* Replace `mkdir(PATH, 755)` to `mkdir(PATH, 0755)`
* 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.)
* Removed `?>` to prevent whitespace.
- Removed unused vars
- Replace tabs by spaces (size 4)
- Added `=== false` misses in `isset()`
- Improved type
- Removed `empty($maxExec)`
- Removed unnecessary `=== true`
- Replace `mkdir(PATH, 755)` to `mkdir(PATH, 0755)`
- 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.)
- Removed `?>` to prevent whitespace.

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

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

## html2canvas-php-proxy 0.1.5 - 04.05.2014

* Improved "typing" for better updates/pull-request
* Converted various variables to (int)
* Removed must-revalidate in header
* Improved forks
* Improved http response, If http_status<>200, return error in html2canvas
* Fixed bug in Facebook redirect (HTTP/1.1 302 forced.302)
* Removed unnecessary Etag-header
* Fixed undefined variables
* Fixed bug in `json_encode_string` (characters)
* Fixed "invalid escapes" in `json_encode_string`
* Improved performance in `json_encode_string`
* Removed `utf8_encode` (unnecessary) in `json_encode_string`
* Fixed bug in `relative2absolute`
* `downloadSource` always returns array
* Replace `error_get_last` by `get_error`
* Added comments in functions
- Improved "typing" for better updates/pull-request
- Converted various variables to (int)
- Removed must-revalidate in header
- Improved forks
- Improved http response, If http_status<>200, return error in html2canvas
- Fixed bug in Facebook redirect (HTTP/1.1 302 forced.302)
- Removed unnecessary Etag-header
- Fixed undefined variables
- Fixed bug in `json_encode_string` (characters)
- Fixed "invalid escapes" in `json_encode_string`
- Improved performance in `json_encode_string`
- Removed `utf8_encode` (unnecessary) in `json_encode_string`
- Fixed bug in `relative2absolute`
- `downloadSource` always returns array
- Replace `error_get_last` by `get_error`
- Added comments in functions


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

* Added support to javascript functions based in Objects (update to 0.1.2)
* Fixed bug in 0.1.2 (update to 0.1.3)
* Added support to "relative paths" (function relative2absolute) (0.1.4)
* Added "referrer header" (if exists) (0.1.4)
* Added "remove charset" for mime-types (eg. text/html; charset=ut8 => text/html) (0.1.4)
* Added prefix in files created by html2canvas-php-proxy (0.1.4)
* "remove_old_files function" removes only the files with prefix (0.1.4)
- Added support to javascript functions based in Objects (update to 0.1.2)
- Fixed bug in 0.1.2 (update to 0.1.3)
- Added support to "relative paths" (function relative2absolute) (0.1.4)
- Added "referrer header" (if exists) (0.1.4)
- Added "remove charset" for mime-types (eg. text/html; charset=ut8 => text/html) (0.1.4)
- Added prefix in files created by html2canvas-php-proxy (0.1.4)
- "remove_old_files function" removes only the files with prefix (0.1.4)


## html2canvas-php-proxy 0.1.1 - 01.12.2013

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


## html2canvas-php-proxy 0.1.0 - 24.11.2013

* Script completely rewritten
* Added detection list "Content-length:" header
* Added alternative to callback parameter (eg. The function call is `console.log` or `alert()`, if there is no callback parameter)
* Added support for detecting max_execution_time
* Added the use of `erro_get_last()`
* Added support for "Location:" header
* Added support for detecting 304 HTTP, return an error warning (socket does not use/send Etags)
* Added `utf8_encode` to `json_encode` to prevent the error string becomes NULL
* Added an error warning, if there is no the file "Content-type:" header
* In case of HTTP 3xx response, if there is no "Location:" header, returns an error warning
* Improved response headers from proxy (`function setHeaders`)
* Improved validation http/https (`function isHttpUrl`)
* Prevent warning in `rename()` (PHP 5.2 in CGI), because the warning `return false;`
* In addition to other improvements when the script was rewritten
- Script completely rewritten
- Added detection list "Content-length:" header
- Added alternative to callback parameter (eg. The function call is `console.log` or `alert()`, if there is no callback parameter)
- Added support for detecting max_execution_time
- Added the use of `erro_get_last()`
- Added support for "Location:" header
- Added support for detecting 304 HTTP, return an error warning (socket does not use/send Etags)
- Added `utf8_encode` to `json_encode` to prevent the error string becomes NULL
- Added an error warning, if there is no the file "Content-type:" header
- In case of HTTP 3xx response, if there is no "Location:" header, returns an error warning
- Improved response headers from proxy (`function setHeaders`)
- Improved validation http/https (`function isHttpUrl`)
- Prevent warning in `rename()` (PHP 5.2 in CGI), because the warning `return false;`
- In addition to other improvements when the script was rewritten


## html2canvas-php-proxy 0.0.4 - 20.11.2013

* Fixed tmp fileName $locationFile.$token
* Use complete URI scheme for https
- Fixed tmp fileName $locationFile.$token
- Use complete URI scheme for https
24 changes: 12 additions & 12 deletions README.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html><html><head><meta charset="utf-8"><style>body {
<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><style>body {
max-width: 980px;
border: 1px solid #ddd;
outline: 1300px solid #fff;
Expand Down Expand Up @@ -841,7 +841,7 @@
inset 0 -12px 0 rgba(0, 0, 0, .05);
}

/* Multimarkdown Critic Blocks */
/* MultiMarkdown Critic Blocks */
.markdown-body .critic_mark {
background: #ff0;
}
Expand Down Expand Up @@ -992,7 +992,7 @@
page-break-after: avoid;
}
}
</style><style>/*github*/
</style><style>/*GitHub*/
.codehilite {background-color:#fff;color:#333333;}
.codehilite .hll {background-color:#ffffcc;}
.codehilite .c{color:#999988;font-style:italic}
Expand Down Expand Up @@ -1055,7 +1055,7 @@
.codehilite .vi{color:teal}
.codehilite .il{color:#009999}
.codehilite .gc{color:#999;background-color:#EAF2F5}
</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>
</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>
<h2 id="php-proxy-html2canvas">PHP Proxy html2canvas<a class="headerlink" href="#php-proxy-html2canvas" title="Permanent link"></a></h2>
<p>This script allows you to use <strong>html2canvas.js</strong> with different servers, ports and protocols (http, https),
preventing to occur &ldquo;tainted&rdquo; when exporting the <code>&lt;canvas&gt;</code> for image.</p>
Expand Down Expand Up @@ -1139,12 +1139,12 @@ <h2 id="setup">Setup<a class="headerlink" href="#setup" title="Permanent link">
<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>
</tr>
<tr>
<td><code>define('H2CP_ALLOWED_DOMAINS', array( '*' ));</code></td>
<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>
<td><code>define('H2CP_ALLOWED_DOMAINS', '*');</code></td>
<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>
</tr>
<tr>
<td><code>define('H2CP_ALLOWED_PORTS', array( 80, 443 ));</code></td>
<td>Config allowed ports</td>
<td><code>define('H2CP_ALLOWED_PORTS', '80,443');</code></td>
<td>Config allowed ports (<code>string</code> separed by commas)</td>
</tr>
</tbody>
</table>
Expand Down Expand Up @@ -1201,12 +1201,12 @@ <h2 id="usage">Usage<a class="headerlink" href="#usage" title="Permanent link">

<h2 id="using-web-console">Using Web Console<a class="headerlink" href="#using-web-console" title="Permanent link"></a></h2>
<p>If you have any problems with the script recommend to analyze the log use the Web Console from your browser:
<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>
</em> Chrome: <a href="https://developers.google.com/chrome-developer-tools/docs/console">https://developers.google.com/chrome-developer-tools/docs/console</a>
* Firefox: <a href="https://developer.mozilla.org/en-US/docs/Tools/Browser_Console">https://developer.mozilla.org/en-US/docs/Tools/Browser_Console</a>
* Chrome: <a href="https://developers.google.com/chrome-developer-tools/docs/console">https://developers.google.com/chrome-developer-tools/docs/console</a>
* 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>
<p>Get NetWork results:
<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>
</em> Chrome: <a href="https://developers.google.com/chrome-developer-tools/docs/network">https://developers.google.com/chrome-developer-tools/docs/network</a>
* 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>
* Chrome: <a href="https://developers.google.com/chrome-developer-tools/docs/network">https://developers.google.com/chrome-developer-tools/docs/network</a>
* 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>
<p>An alternative is to diagnose problems accessing the link directly:</p>
<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>
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## html2canvas-php-proxy 1.0.0
## html2canvas-php-proxy

## PHP Proxy html2canvas

Expand Down
Loading

0 comments on commit aa05670

Please sign in to comment.