- && !Validate::uri($homepage,
- array('allowed_schemes' => array('http', 'https'))))
- {
- // TRANS: Validation error shown when providing an invalid homepage URL in the "Edit application" form.
- $this->showForm(_('Homepage is not a valid URL.'));
- return;
- } elseif (mb_strlen($callback_url) > 255) {
- // TRANS: Validation error shown when providing too long a callback URL in the "Edit application" form.
- $this->showForm(_('Callback is too long.'));
- return;
- } elseif (mb_strlen($callback_url) > 0
- && !Validate::uri($source_url,
- array('allowed_schemes' => array('http', 'https'))
- ))
- {
- // TRANS: Validation error shown when providing an invalid callback URL in the "Edit application" form.
- $this->showForm(_('Callback URL is not valid.'));
- return;
- }
+ && !common_valid_http_url($homepage)) {
+ // TRANS: Validation error shown when providing an invalid homepage URL in the "Edit application" form.
+ $this->showForm(_('Homepage is not a valid URL.'));
+ return;
+ } elseif (mb_strlen($callback_url) > 255) {
+ // TRANS: Validation error shown when providing too long a callback URL in the "Edit application" form.
+ $this->showForm(_('Callback is too long.'));
+ return;
+ } elseif (mb_strlen($callback_url) > 0
+ && !common_valid_http_url($callback_url)) {
+ // TRANS: Validation error shown when providing an invalid callback URL in the "Edit application" form.
+ $this->showForm(_('Callback URL is not valid.'));
+ return;
+ }