Fix so task name can really contain all from a-z0-9_- characters (#1488941)
| | |
| | | CHANGELOG Roundcube Webmail |
| | | =========================== |
| | | |
| | | - Fix so task name can really contain all from a-z0-9_- characters (#1488941) |
| | | - Support IMAP MOVE extension [RFC 6851] |
| | | - Fix javascript errors when working in a page opened with taget="_blank" |
| | | - Mention SQLite database format change in UPGRADING file (#1488983) |
| | |
| | | */ |
| | | public function set_task($task) |
| | | { |
| | | $task = asciiwords($task); |
| | | $task = asciiwords($task, true); |
| | | |
| | | if ($this->user && $this->user->ID) |
| | | $task = !$task ? 'mail' : $task; |
| | |
| | | if (!url) |
| | | url = this.env.comm_path; |
| | | |
| | | return url.replace(/_task=[a-z]+/, '_task='+task); |
| | | return url.replace(/_task=[a-z0-9_-]+/i, '_task='+task); |
| | | }; |
| | | |
| | | this.reload = function(delay) |
| | |
| | | var base = this.env.comm_path, k, param = {}; |
| | | |
| | | // overwrite task name |
| | | if (query._action.match(/([a-z]+)\/([a-z0-9-_.]+)/)) { |
| | | if (query._action.match(/([a-z0-9_-]+)\/([a-z0-9-_.]+)/)) { |
| | | query._action = RegExp.$2; |
| | | base = base.replace(/\_task=[a-z]+/, '_task='+RegExp.$1); |
| | | base = base.replace(/\_task=[a-z0-9_-]+/, '_task='+RegExp.$1); |
| | | } |
| | | |
| | | // remove undefined values |
| | |
| | | /** |
| | | * Register this plugin to be responsible for a specific task |
| | | * |
| | | * @param string $task Task name (only characters [a-z0-9_.-] are allowed) |
| | | * @param string $task Task name (only characters [a-z0-9_-] are allowed) |
| | | */ |
| | | public function register_task($task) |
| | | { |
| | |
| | | /** |
| | | * Register this plugin to be responsible for a specific task |
| | | * |
| | | * @param string $task Task name (only characters [a-z0-9_.-] are allowed) |
| | | * @param string $task Task name (only characters [a-z0-9_-] are allowed) |
| | | * @param string $owner Plugin name that registers this action |
| | | */ |
| | | public function register_task($task, $owner) |
| | |
| | | return true; |
| | | } |
| | | |
| | | if ($task != asciiwords($task)) { |
| | | if ($task != asciiwords($task, true)) { |
| | | rcube::raise_error(array('code' => 526, 'type' => 'php', |
| | | 'file' => __FILE__, 'line' => __LINE__, |
| | | 'message' => "Invalid task name: $task." |