Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sanitize trim($year) to avoid PHP warning #130

Closed
wants to merge 1 commit into from

Conversation

JocelynDelalande
Copy link

The fact trim($year) was called without sanitization leads to log errors like:

ERROR - 2015-01-17 08:30:29 --> Severity: Warning  --> trim() expects parameter 1 to be string, array given /var/www/agendav/libs/icalcreator/iCalcreator.class.php 8639

While adding an event to the calendar from web interface.

Even worse, this output was bundled in the POST request response for event creation :

<p>Severity: Warning</p>
<p>Message:  trim() expects parameter 1 to be string, array given</p>
<p>Filename: icalcreator/iCalcreator.class.php</p>
<p>Line Number: 8638</p>
<p>Severity: Warning</p>
<p>Message:  trim() expects parameter 1 to be string, array given</p>
<p>Filename: icalcreator/iCalcreator.class.php</p>
<p>Line Number: 8638</p>

which leads to json parsing error.

This PR fixes that.

The fact trim($year) was called without sanitization leads to log errors like:

```
ERROR - 2015-01-17 08:30:29 --> Severity: Warning  --> trim() expects parameter 1 to be string, array given /var/www/agendav/libs/icalcreator/iCalcreator.class.php 8639
```

While adding an event to the calendar from web interface.

Even worse, this output was bundled in the *POST* request response for event creation :

```
<p>Severity: Warning</p>
<p>Message:  trim() expects parameter 1 to be string, array given</p>
<p>Filename: icalcreator/iCalcreator.class.php</p>
<p>Line Number: 8638</p>
<p>Severity: Warning</p>
<p>Message:  trim() expects parameter 1 to be string, array given</p>
<p>Filename: icalcreator/iCalcreator.class.php</p>
<p>Line Number: 8638</p>
```

which leads to json parsing error.

This PR fixes that.
@JocelynDelalande
Copy link
Author

Also reported upstream : iCalcreator/iCalcreator#12

@jorgelzpz
Copy link
Collaborator

@JocelynDelalande thank you for your detailed PR! Unfortunately, current development branch (develop) is using Sabre VObject instead of iCalcreator. I forgot to remove references to iCalcreator, but current develop branch doesn't use iCalcreator at all.

Thank you again!

@jorgelzpz jorgelzpz closed this Jan 17, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants