5am-code / laravel-notion-api

Effortless Notion integrations with Laravel
https://notionforlaravel.com
MIT License
410 stars 50 forks source link

Do not serialize scalar values #129

Closed richardhj closed 1 year ago

richardhj commented 1 year ago

I don't know why all properties are becoming json_encoded, but this resulted in properties having malicious characters (i.e., ") when using asText().

Example:

Before:

$page->getProperty('E-Mail-Adresse')->asText(); // "me@example.org"

After:

$page->getProperty('E-Mail-Adresse')->asText(); // me@example.org
what-the-diff[bot] commented 1 year ago

PR Summary

johguentner commented 1 year ago

Thank you @richardhj for the PR! Yeah, this is a valid point! When I wrote the ->asText() method, I wasn't sure what to do with certain properties. For scalar values, this definitely makes sense!

Could you please write tests for the implementation. Then we will merge this within 1.1.0.