Skip to content

Commit 125c55f

Browse files
authored
Merge pull request #18 from vdhicts/master
Remove deprecated FILTER_SANITIZE_STRING
2 parents 4a2cab2 + 722e99a commit 125c55f

File tree

5 files changed

+3
-12
lines changed

5 files changed

+3
-12
lines changed

src/FabianBeiner/Todoist/TodoistCommentsTrait.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,9 @@ public function createComment(string $commentType, int $typeId, string $comment)
108108
}
109109

110110
$data = $this->preparePostData([
111-
$commentType . '_id' => $typeId,
112-
'content' => $comment,
113-
]);
111+
$commentType . '_id' => $typeId,
112+
'content' => $comment,
113+
]);
114114
/** @var object $result Result of the POST request. */
115115
$result = $this->post('comments', $data);
116116

@@ -168,7 +168,6 @@ public function getComment(int $commentId)
168168
*/
169169
public function updateComment(int $commentId, string $content): bool
170170
{
171-
$content = filter_var($content, FILTER_SANITIZE_STRING);
172171
if ( ! strlen($content) || ! $this->validateId($commentId)) {
173172
return false;
174173
}

src/FabianBeiner/Todoist/TodoistLabelsTrait.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ public function getAllLabels()
4747
*/
4848
public function createLabel(string $labelName, array $optionalParameters = [])
4949
{
50-
$labelName = filter_var($labelName, FILTER_SANITIZE_STRING);
5150
if ( ! strlen($labelName)) {
5251
return false;
5352
}
@@ -104,7 +103,6 @@ public function getLabel(int $labelId)
104103
*/
105104
public function updateLabel(int $labelId, string $newLabelName, array $optionalParameters = []): bool
106105
{
107-
$newLabelName = filter_var($newLabelName, FILTER_SANITIZE_STRING);
108106
if ( ! strlen($newLabelName) || ! $this->validateId($labelId)) {
109107
return false;
110108
}

src/FabianBeiner/Todoist/TodoistProjectsTrait.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ public function getAllProjects()
4747
*/
4848
public function createProject(string $projectName, array $optionalParameters = [])
4949
{
50-
$projectName = filter_var($projectName, FILTER_SANITIZE_STRING);
5150
if ( ! strlen($projectName)) {
5251
return false;
5352
}
@@ -102,7 +101,6 @@ public function getProject(int $projectId)
102101
*/
103102
public function updateProject(int $projectId, string $newProjectName, array $optionalParameters = []): bool
104103
{
105-
$newProjectName = filter_var($newProjectName, FILTER_SANITIZE_STRING);
106104
if ( ! strlen($newProjectName) || ! $this->validateId($projectId)) {
107105
return false;
108106
}

src/FabianBeiner/Todoist/TodoistSectionsTrait.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ public function getAllSections(int $projectId = 0)
5555
*/
5656
public function createSection(string $sectionName, int $projectId, array $optionalParameters = [])
5757
{
58-
$sectionName = filter_var($sectionName, FILTER_SANITIZE_STRING);
5958
if ( ! strlen($sectionName) || ! $this->validateId($projectId)) {
6059
return false;
6160
}
@@ -110,7 +109,6 @@ public function getSection(int $sectionId)
110109
*/
111110
public function updateSection(int $sectionId, string $newSectionName): bool
112111
{
113-
$newSectionName = filter_var($newSectionName, FILTER_SANITIZE_STRING);
114112
if ( ! strlen($newSectionName) || ! $this->validateId($sectionId)) {
115113
return false;
116114
}

src/FabianBeiner/Todoist/TodoistTasksTrait.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ public function getAllTasks(array $options = [])
4848
*/
4949
public function createTask(string $content, array $options = [])
5050
{
51-
$content = filter_var($content, FILTER_SANITIZE_STRING);
5251
if ( ! strlen($content)) {
5352
return false;
5453
}
@@ -92,7 +91,6 @@ public function getTask(int $taskId)
9291
*/
9392
public function updateTask(int $taskId, string $content = null, array $options = []): bool
9493
{
95-
$content = filter_var($content, FILTER_SANITIZE_STRING);
9694
if ( ! $this->validateId($taskId)) {
9795
return false;
9896
}

0 commit comments

Comments
 (0)