Need advice on escaping nasty string
- Status
- Open
- Subject
- Need advice on escaping nasty string
- Version
- 18.x
- Category
- Support request
- Feature
- Admin Interface (UI)
i18n (Multilingual, l10n, Babelfish) - Resolution status
- New
- Submitted by
- hman
- Lastmod by
- hman
- Rating
- Description
There is a string in /lib/prefs/username.php that really gives me headaches. How on earth does this have to be escaped, so tra() will catch it from the array_merge in custom.php?
Here is the entire file:
Copy to clipboard<?php // (c) Copyright 2002-2016 by authors of the Tiki Wiki CMS Groupware Project // // All Rights Reserved. See copyright.txt for details and a complete list of authors. // Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details. // $Id: username.php 66909 2018-07-07 14:48:30Z chibaguy $ function prefs_username_list() { return [ 'username_pattern' => [ 'name' => tra('Username pattern'), 'description' => tr('This regex pattern requires or forbids the use of certain characters for username. For example to add Hebrew use: /^[ \'\-_a-zA-Z0-9@\.א-ת]*$/ or for Chinese use: /^[ \'\-_a-zA-Z0-9@\.\x00-\xff]*$/'), 'type' => 'text', 'size' => 25, 'perspective' => false, 'default' => '/^[ \'\-_a-zA-Z0-9@\.]*$/', ], ]; }
I hope you had at least some fun constructing this string... Now I have to rewrite this in double quotes, because that is the syntax in custom.php...Thanks
hman- Importance
- 7
- Easy to solve?
- 8
- Priority
- 56
- Demonstrate Bug on Tiki 19+
-
This bug has been demonstrated on show2.tiki.org
Please demonstrate your bug on show2.tiki.org
Show.tiki.org is not configured properlyThe public/private keys configured to connect to show2.tiki.org were not accepted. Please make sure you are using RSA keys. Thanks.
- Demonstrate Bug (older Tiki versions)
-
This bug has been demonstrated on show.tikiwiki.org
Please demonstrate your bug on show.tikiwiki.org
Show.tiki.org is not configured properlyThe public/private keys configured to connect to show.tikiwiki.org were not accepted. Please make sure you are using RSA keys. Thanks.
- Ticket ID
- 7489
- Created
- Friday 14 August, 2020 12:02:59 UTC
by hman - LastModif
- Friday 14 August, 2020 12:06:22 UTC