Skip to content

Commit 31fa918

Browse files
author
Phil Sturgeon
committed
Added a helper function for returning an array of validation errors instead of a string.
1 parent e86ecc9 commit 31fa918

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

application/libraries/REST_Controller.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -490,6 +490,13 @@ private function _xss_clean($val, $bool)
490490
}
491491
}
492492

493+
public function validation_errors()
494+
{
495+
$string = strip_tags($this->form_validation->error_string());
496+
497+
return explode("\n", trim($string, "\n"));
498+
}
499+
493500
// SECURITY FUNCTIONS ---------------------------------------------------------
494501

495502
private function _check_login($username = '', $password = NULL)

0 commit comments

Comments
 (0)