Use of short tags
Reported by Kyle Gordon | February 8th, 2010 @ 07:04 PM
Hi,
Several of the PHP files within Concerto use short tags instead of complete tags, ie <? instead of <?php. This is rather non-portable, and causes major breakage on SUSE systems at the very least. It can be worked around by changing short_open_tag = On, but this is not the default shipping setting for SuSE and possibly others, and is also not recommended.
To quote from php.ini on SuSE, Ubuntu and Debian distros - "Using short tags should be avoided when developing applications or libraries that are meant for redistribution, or deployment on PHP servers which are not under your control, because short tags may not be supported on the target server. For portable, redistributable code, be sure not to use short tags."
I've had a quick look, and there's quite a few files that at least have it as the opening line. There are many more with it embedded in the file somewhere
root@flat:/var/www/concerto# find . -iname "*.php" -exec grep -i
'<?$' {} \; | wc -l
58
root@flat:/var/www/concerto#
I'm sure there's a way to mass replace it all with sed/grep/find/etc!
Regards
Kyle
Comments and changes to this ticket
-
Brian Michalski February 11th, 2010 @ 10:27 PM
You've got a valid point, our code is covered in short tags. We've used short tags because they're much easier on the eyes when you're editing the code than a <?php echo $foo ?>. Compressing a statement like that to <?= $foo ?> saves a few characters and makes the code a tad easier to follow.
This site: http://mantis.phplist.com/view.php?id=1175 references a script that might do it, but I can't vouch for its effectiveness.
-
Brian Michalski February 11th, 2010 @ 10:32 PM
- State changed from new to hold
I'm not going to mark this invalid because its a completely valid problem. We'll need to talk about this at some point.
-
Andrew Elwell February 12th, 2010 @ 08:23 AM
- Tag cleared.
see http://cern.ch/aelwell/scratch/concerto_short_tag_fixup.patch
(done with sed)
-
Kevin Russell July 20th, 2011 @ 12:59 AM
- Milestone order changed from 0 to 0
Although I didn't use the patch supplied by Andrew (link appear broken), I have pushed similar fix to GitHub (non-cas). I need to use the long tags in my environment.
-
Brian Michalski April 30th, 2012 @ 02:18 AM
- State changed from hold to resolved
(from [526af4ff549b2f418712741614a68001d4e0a50c]) adding authorization/role logic to Groups#show. closes #69 https://github.com/concerto/concerto/commit/526af4ff549b2f418712741...
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป
Concerto is an open source digital signage system that makes it easy to engage a large community of people with graphical and text-based announcements, bulletins, and other messages... but enough about us, you came here to get involved.
<br />
If you think you've <b>found a bug in Concerto</b>, please click 'Create new ticket' and let us know about it.
<br />
Looking to peek at our source code? Head to <a href="https://github.com/concerto/concerto_v1">https://github.com/concerto/concerto_v1</a> (Concerto version 1) or <a href="https://github.com/concerto/concerto">https://github.com/concerto/concerto</a> (Concerto version 2).
<br />
Our getting started guide is available here: <a href="https://github.com/concerto/concerto/wiki/Getting-Involved">https://github.com/concerto/concerto/wiki/Getting-Involved</a>.