Commit c0639ce6 authored by Carsten  Rose's avatar Carsten Rose
Browse files

AbstractBuildForm.php: fixed bug that empty formElement['maxlength'] parameter crashes substr().

parent 8595e0c5
......@@ -1676,7 +1676,7 @@ abstract class AbstractBuildForm {
}
// truncate if necessary
if ($value != '') {
if ($value != '' && $formElement['maxLength'] > 0) {
$value = substr($value, 0, $formElement['maxLength']);
}
......
......@@ -16,6 +16,7 @@ DROP TABLE IF EXISTS Note;
CREATE TABLE Note (
id BIGINT AUTO_INCREMENT PRIMARY KEY,
gr_id INT(11) NOT NULL DEFAULT 0,
person_id BIGINT(20) DEFAULT NULL,
value VARCHAR(128),
t1 TEXT,
t2 TEXT
......@@ -25,3 +26,20 @@ INSERT INTO Note (gr_id, value, t1, t2) VALUES
(1, 'First note - constants', 'Latest Information', 'Dear User\nt\n you\'re invited to to our Christmas party'),
(2, 'Second note - some variables', 'Latest Information: {{party:C:all}}',
'Dear {{Firstname:C:all}} {{Lastname:C:all}}\n\n you\'re invited to to our Christmas party');
DROP TABLE IF EXISTS Address;
CREATE TABLE Address (
id BIGINT(20) NOT NULL AUTO_INCREMENT,
person_id BIGINT(20) NOT NULL DEFAULT 0,
street VARCHAR(128) NOT NULL DEFAULT '',
city VARCHAR(128) NOT NULL DEFAULT '',
country ENUM('', 'Switzerland', 'Austria', 'France', 'Germany') NOT NULL DEFAULT '',
PRIMARY KEY (`id`)
);
INSERT INTO Address (person_id, street, city) VALUES
(1, 'Side Street', 'Zurich'),
(1, 'Park Street', 'Zurich'),
(1, 'Winter Street', 'Zurich'),
(2, 'Summer Street', 'Zurich');
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment