Indefero

Indefero Commit Details


Date:2010-06-25 17:07:56 (14 years 5 months ago)
Author:Thomas Keller
Branch:develop, feature-issue_links, feature.better-home, feature.content-md5, feature.diff-whitespace, feature.download-md5, feature.issue-links, feature.issue-of-others, feature.issue-summary, feature.search-filter, feature.webrepos, feature.wiki-default-page, master, release-1.1, release-1.2, release-1.3
Commit:8decc383aac0f501d40b9217e38b7662932a7746
Parents: f3268b3d37695273dae781676b8f87c3395993a9
Message:bugfix: do not validate the custom branch field in the project creation formular if we should set the project up with another SCM

Changes:

File differences

src/IDF/Form/Admin/ProjectCreate.php
167167
168168
169169
170
171
172
173
174
170175
171
172
176
177
178
179
180
181
173182
174183
175
184
185
176186
177187
178
188
189
190
179191
192
180193
181194
182195
public function clean_mtn_master_branch()
{
// do not validate, but empty the field if a different
// SCM should be used
if ($this->cleaned_data['scm'] != 'mtn')
return '';
$mtn_master_branch = mb_strtolower($this->cleaned_data['mtn_master_branch']);
if (!preg_match('/^([\w\d]+([-][\w\d]+)*)(\.[\w\d]+([-][\w\d]+)*)*$/', $mtn_master_branch)) {
throw new Pluf_Form_Invalid(__('This master branch contains illegal characters, please use only letters, digits, dashs and dots as separators.'));
if (!preg_match('/^([\w\d]+([-][\w\d]+)*)(\.[\w\d]+([-][\w\d]+)*)*$/',
$mtn_master_branch)) {
throw new Pluf_Form_Invalid(__(
'The master branch is empty or contains illegal characters, '.
'please use only letters, digits, dashs and dots as separators.'
));
}
$sql = new Pluf_SQL('vkey=%s AND vdesc=%s', array("mtn_master_branch", $mtn_master_branch));
$sql = new Pluf_SQL('vkey=%s AND vdesc=%s',
array("mtn_master_branch", $mtn_master_branch));
$l = Pluf::factory('IDF_Conf')->getList(array('filter'=>$sql->gen()));
if ($l->count() > 0) {
throw new Pluf_Form_Invalid(__('This master branch is already used. Please select another one.'));
throw new Pluf_Form_Invalid(__(
'This master branch is already used. Please select another one.'
));
}
return $mtn_master_branch;
}

Archive Download the corresponding diff file

Page rendered in 0.07916s using 13 queries.