Indefero

Indefero Commit Details


Date:2009-01-02 10:26:52 (15 years 11 months ago)
Author:Loic d'Anterroches
Branch:dev, 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:c949672e53b2d1ff58577d9a8bc5c7316d9ab85f
Parents: c8d1b66c91c11b91efc8adef92fe50cfdcd32f94
Message:Fixed to allow the dash (-) in the shortname of a project.

The dash is not allowed as first or last character of the name.
Changes:

File differences

src/IDF/Form/Admin/ProjectCreate.php
126126
127127
128128
129
129
130130
131131
132
133
134
135
136
137
132138
133139
134140
public function clean_shortname()
{
$shortname = $this->cleaned_data['shortname'];
if (preg_match('/[^A-Za-z0-9]/', $shortname)) {
if (preg_match('/[^\-A-Za-z0-9]/', $shortname)) {
throw new Pluf_Form_Invalid(__('This shortname contains illegal characters, please use only letters and digits.'));
}
if (mb_substr($shortname, 0, 1) == '-') {
throw new Pluf_Form_Invalid(__('The shortname cannot start with the dash (-) character.'));
}
if (mb_substr($shortname, -1) == '-') {
throw new Pluf_Form_Invalid(__('The shortname cannot end with the dash (-) character.'));
}
$sql = new Pluf_SQL('shortname=%s', array($shortname));
$l = Pluf::factory('IDF_Project')->getList(array('filter'=>$sql->gen()));
if ($l->count() > 0) {

Archive Download the corresponding diff file

Page rendered in 0.08344s using 13 queries.