diff options
author | Robin McCorkell <rmccorkell@karoshi.org.uk> | 2014-03-20 18:28:42 +0000 |
---|---|---|
committer | Robin McCorkell <rmccorkell@karoshi.org.uk> | 2014-03-20 18:28:42 +0000 |
commit | 7a0eccfc63e80ea27188032135560dbb45a1e5cb (patch) | |
tree | 0692f6e7cb295fd7a037693b8b52eb18f87fb352 /apps/files_external/templates | |
parent | ed0c10a10b0b3a9d9d898a64461de707026cd6d3 (diff) | |
download | nextcloud-server-7a0eccfc63e80ea27188032135560dbb45a1e5cb.tar.gz nextcloud-server-7a0eccfc63e80ea27188032135560dbb45a1e5cb.zip |
Correct field modifier checking
Existing code checks for the existence of a modifier ('&', '!', '#', '*')
anywhere in the field name, but strips the first character regardless. This
change makes it so that only modifiers at the beginning of the string are
counted.
Diffstat (limited to 'apps/files_external/templates')
-rw-r--r-- | apps/files_external/templates/settings.php | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/apps/files_external/templates/settings.php b/apps/files_external/templates/settings.php index 8e9355dd8a5..ecbde442de0 100644 --- a/apps/files_external/templates/settings.php +++ b/apps/files_external/templates/settings.php @@ -52,18 +52,18 @@ $placeholder = substr($placeholder, 1); } ?> - <?php if (strpos($placeholder, '*') !== false): ?> + <?php if (strpos($placeholder, '*') === 0): ?> <input type="password" <?php if ($is_optional): ?> class="optional"<?php endif; ?> data-parameter="<?php p($parameter); ?>" value="<?php p($value); ?>" placeholder="<?php p(substr($placeholder, 1)); ?>" /> - <?php elseif (strpos($placeholder, '!') !== false): ?> + <?php elseif (strpos($placeholder, '!') === 0): ?> <label><input type="checkbox" data-parameter="<?php p($parameter); ?>" <?php if ($value == 'true'): ?> checked="checked"<?php endif; ?> /><?php p(substr($placeholder, 1)); ?></label> - <?php elseif (strpos($placeholder, '#') !== false): ?> + <?php elseif (strpos($placeholder, '#') === 0): ?> <input type="hidden" data-parameter="<?php p($parameter); ?>" value="<?php p($value); ?>" /> |