From b6f1a418e882c68c8c727380af208a50b10b2749 Mon Sep 17 00:00:00 2001 From: Laurent Sarrazin Date: Thu, 28 Apr 2016 09:16:35 +0200 Subject: [PATCH 01/11] Loosen html-purifier version constraint --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 3e388fc..5fe624c 100644 --- a/composer.json +++ b/composer.json @@ -23,7 +23,7 @@ }, "require": { "php": ">=5.3", - "ezyang/htmlpurifier": "~4.6.0", + "ezyang/htmlpurifier": "^4.6.0", "tijsverkoyen/css-to-inline-styles": "~1.5", "psr/log": "~1.0" }, From 4f0753159e065851b87262f480c711dbeb8d3aae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=BE=E6=99=BA=E8=81=96?= Date: Sat, 7 May 2016 09:50:22 +0800 Subject: [PATCH 02/11] To fix "A session had already been started - ignoring session_start()" --- src/Evernote/Auth/OauthHandler.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Evernote/Auth/OauthHandler.php b/src/Evernote/Auth/OauthHandler.php index 064c019..276c935 100644 --- a/src/Evernote/Auth/OauthHandler.php +++ b/src/Evernote/Auth/OauthHandler.php @@ -44,6 +44,10 @@ public function authorize($consumer_key, $consumer_secret, $callback) $this->consumer_secret = $consumer_secret; + if (session_status() == PHP_SESSION_NONE) { + session_start(); + } + // first call if (!array_key_exists('oauth_verifier', $_GET) && !array_key_exists('oauth_token', $_GET)) { session_start(); From 35d1b4a9d46df8fca441da4a5751ab3c24b5ff21 Mon Sep 17 00:00:00 2001 From: kingfui Date: Fri, 27 May 2016 16:52:29 +0100 Subject: [PATCH 03/11] remove extraneous session_start() --- src/Evernote/Auth/OauthHandler.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/Evernote/Auth/OauthHandler.php b/src/Evernote/Auth/OauthHandler.php index 276c935..c3b5a4d 100644 --- a/src/Evernote/Auth/OauthHandler.php +++ b/src/Evernote/Auth/OauthHandler.php @@ -50,7 +50,6 @@ public function authorize($consumer_key, $consumer_secret, $callback) // first call if (!array_key_exists('oauth_verifier', $_GET) && !array_key_exists('oauth_token', $_GET)) { - session_start(); unset($this->params['oauth_token']); unset($this->params['oauth_verifier']); @@ -73,7 +72,6 @@ public function authorize($consumer_key, $consumer_secret, $callback) throw new AuthorizationDeniedException('Authorization declined.'); //the user authorized the app } else { - session_start(); $this->token_secret = $_SESSION['oauth_token_secret']; $this->params['oauth_token'] = $_GET['oauth_token']; From 54d5c53ae9fa206d602aa8da58de3f0e1421102c Mon Sep 17 00:00:00 2001 From: Ben Lucas Date: Mon, 18 Jul 2016 11:58:31 -0400 Subject: [PATCH 04/11] updated XML/DTD decoration fix to decorate with either XML declaration, DOCTYPE declaration, or both --- src/Evernote/Model/EnmlNoteContent.php | 27 +++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/src/Evernote/Model/EnmlNoteContent.php b/src/Evernote/Model/EnmlNoteContent.php index b387bee..729852f 100644 --- a/src/Evernote/Model/EnmlNoteContent.php +++ b/src/Evernote/Model/EnmlNoteContent.php @@ -12,9 +12,13 @@ class EnmlNoteContent extends NoteContent implements NoteContentInterface public function __construct($content, HtmlConverterInterface $htmlConverter = null) { if (!$this->hasXmlDeclaration($content)) { - $content = $this->decorate($content); + $content = $this->addXmlDeclaration($content); } - + + if (!$this->hasDoctypeDeclaration($content)) { + $content = $this->addDoctypeDeclaration($content); + } + $this->content = $content; $this->htmlConverter = $htmlConverter; } @@ -57,14 +61,27 @@ protected function hasXmlDeclaration($content) { return substr(trim($content), 0, 5) == ' +$content +ENML; + + } + + protected function addDoctypeDeclaration($content) + { + return << $content ENML; } -} \ No newline at end of file +} From 92ccf709e90f2372822d394a07242bd29169dc1d Mon Sep 17 00:00:00 2001 From: Ammar Khaku Date: Thu, 18 Aug 2016 20:46:30 -0700 Subject: [PATCH 05/11] Bump version to 2.0 Also minor README updates. --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 20fe263..2d3b4a9 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -Evernote Cloud SDK 2.0 for PHP (beta) +Evernote Cloud SDK PHP v2.0 ===================================== A newly-redesigned, simple, workflow-oriented library built on the Evernote Cloud API. It's designed to drop into your web app easily and make most common Evernote integrations very simple to accomplish. (And even the more complex integrations easier than they used to be.) @@ -12,7 +12,7 @@ Just run these two commands to install it: ``` bash $ curl -sS https://getcomposer.org/installer | php -$ php composer.phar require evernote/evernote-cloud-sdk-php dev-master +$ php composer.phar require evernote/evernote-cloud-sdk-php ``` Now you can add the autoloader, and you will have access to the library: From 4b2a0b85c9167fe5c26a92365eb07b41cdddd465 Mon Sep 17 00:00:00 2001 From: Ammar Khaku Date: Sat, 24 Sep 2016 13:40:44 -0700 Subject: [PATCH 06/11] Use correct method on notebook. Fix #20 --- src/Evernote/Client.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Evernote/Client.php b/src/Evernote/Client.php index 1ec75b6..91a9deb 100644 --- a/src/Evernote/Client.php +++ b/src/Evernote/Client.php @@ -1111,7 +1111,7 @@ protected function findNotes_findInLinkedScopeWithContext($context) $context->linkedNotebooksToSearch[] = $context->scopeNotebook; } else { foreach ($context->allNotebooks as $notebook) { - if ($notebook->isLinked() && !$notebook->isBusinessNotebook()) { + if ($notebook->isLinkedNotebook() && !$notebook->isBusinessNotebook()) { $context->linkedNotebooksToSearch[] = $notebook; } } From bd46dc6fed41796bcfb22a65cfe1f709aec21d71 Mon Sep 17 00:00:00 2001 From: Ammar Khaku Date: Sat, 24 Sep 2016 13:42:12 -0700 Subject: [PATCH 07/11] Bump version to 2.0.1 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2d3b4a9..8ccf226 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -Evernote Cloud SDK PHP v2.0 +Evernote Cloud SDK PHP v2.0.1 ===================================== A newly-redesigned, simple, workflow-oriented library built on the Evernote Cloud API. It's designed to drop into your web app easily and make most common Evernote integrations very simple to accomplish. (And even the more complex integrations easier than they used to be.) From edb2736859069cf9ce238bd690d1cc47c430d73b Mon Sep 17 00:00:00 2001 From: Pierre Tachoire Date: Fri, 17 Feb 2017 12:17:03 +0100 Subject: [PATCH 08/11] inverse xml and dtd declaration --- src/Evernote/Model/EnmlNoteContent.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Evernote/Model/EnmlNoteContent.php b/src/Evernote/Model/EnmlNoteContent.php index 729852f..fbbfa94 100644 --- a/src/Evernote/Model/EnmlNoteContent.php +++ b/src/Evernote/Model/EnmlNoteContent.php @@ -11,14 +11,14 @@ class EnmlNoteContent extends NoteContent implements NoteContentInterface public function __construct($content, HtmlConverterInterface $htmlConverter = null) { - if (!$this->hasXmlDeclaration($content)) { - $content = $this->addXmlDeclaration($content); - } - if (!$this->hasDoctypeDeclaration($content)) { $content = $this->addDoctypeDeclaration($content); } - + + if (!$this->hasXmlDeclaration($content)) { + $content = $this->addXmlDeclaration($content); + } + $this->content = $content; $this->htmlConverter = $htmlConverter; } From a8c874231ffc0a520eff885ee0c07dfe1759e50c Mon Sep 17 00:00:00 2001 From: Eugene Cooper Date: Tue, 2 May 2017 20:32:03 +0300 Subject: [PATCH 09/11] Update composer.json Update tijsverkoyen/css-to-inline-styles dependency version. The existing one is obsolete and doesn't allow modern frameworks to install the package. --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 5fe624c..c67be3e 100644 --- a/composer.json +++ b/composer.json @@ -24,7 +24,7 @@ "require": { "php": ">=5.3", "ezyang/htmlpurifier": "^4.6.0", - "tijsverkoyen/css-to-inline-styles": "~1.5", + "tijsverkoyen/css-to-inline-styles": "~2.2", "psr/log": "~1.0" }, "autoload": { From c24d691b5ed94ecdf68e738b5dc103b9f2a00022 Mon Sep 17 00:00:00 2001 From: Ammar Khaku Date: Tue, 2 May 2017 10:38:37 -0700 Subject: [PATCH 10/11] Bump version to 2.0.2 --- README.md | 2 +- composer.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8ccf226..6cca212 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -Evernote Cloud SDK PHP v2.0.1 +Evernote Cloud SDK PHP v2.0.2 ===================================== A newly-redesigned, simple, workflow-oriented library built on the Evernote Cloud API. It's designed to drop into your web app easily and make most common Evernote integrations very simple to accomplish. (And even the more complex integrations easier than they used to be.) diff --git a/composer.json b/composer.json index c67be3e..c22704a 100644 --- a/composer.json +++ b/composer.json @@ -7,7 +7,7 @@ "sdk" ], "homepage": "https://github.com/evernote/evernote-cloud-sdk-php", - "version": "2.0", + "version": "2.0.2", "license": "Apache", "authors": [ { From 51c378a5e80fd728b78ba7a2da8aa9544e479b93 Mon Sep 17 00:00:00 2001 From: artpi Date: Sun, 15 Dec 2019 16:29:45 +0100 Subject: [PATCH 11/11] Add __DIR__ to HtmlToEnml converter to make it usable if PWD is outside Converter directory --- src/Evernote/Enml/Converter/HtmlToEnmlConverter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Evernote/Enml/Converter/HtmlToEnmlConverter.php b/src/Evernote/Enml/Converter/HtmlToEnmlConverter.php index d450728..1a6da37 100644 --- a/src/Evernote/Enml/Converter/HtmlToEnmlConverter.php +++ b/src/Evernote/Enml/Converter/HtmlToEnmlConverter.php @@ -44,7 +44,7 @@ public function convertToEnml($content, $base_url = null) $content = $this->cleanHtml($content); //Transform to ENML via XSLT - $enml_body = $this->xslTransform($content, 'html2enml.xslt'); + $enml_body = $this->xslTransform($content, __DIR__ . '/html2enml.xslt'); $enml = <<