View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0001444||Main CAcert Website||source code||public||2018-10-29 20:18||2022-01-05 01:07|
|Status||needs review & testing||Resolution||open|
|Target Version||2017 Q4|
|Summary||0001444: Update PHP <? tags appropriately|
|Description||Go through source code and |
1. change <?= to <? echo
2. change <? to <?php
3. change each() to foreach()
|Additional Information||Part of bug-1260|
|Tags||No tags attached.|
mysql.php seems to be missing from source code for bug-1260. ( should be in includes/mysql.php )
After discussion, I found that this file is "hand-created" on the appropriate server when the code is deployed.
All other required files appear to be present, but they may not be found in a test system because references to them are absolute paths.
||There are hard-coded references to "http://cacert.org," which can probably cause trouble in development and test systems.|
||This code is now available for testing.|
||I found several thousand ( 2500 - 3000 ) instances of required tag changes. Only one instance of each() in the source code that was derived from "release."|
||The ending "?>" tag, at the bottom of PHP source files can be removed.|
I think you shuldn't remove the "?>"tag at the bottom of te PHP source files.
This could cause to assume, some sourcecode could be missing.
Current "best practice" is to omit that tag, because it prevents anything being put into the HTML that is not intended ( extra new lines, extra spaces, etc. ).
On the other hand, I just noted it as something to consider. I did not make this change.
Brian, when trying to merge your changes into the test branch I ran into troubles with the "require_once( "general.php" );" in www/index.php which I still do not understand.
First of all, the path does not look right when compared to the other require_once statements, but even with the path a "not found" error is reported.
Why did you add this line? Other files seem to include require_once("../includes/lib/general.php") or require_once("../includes/mysql.php"), general.php from include seems only to be used by files which are currently not active in the web page...
||I'm sorry, Ted. That was added for testing, and I forgot to remove it afterwards. Done now. general.php is in includes and includes/lib.|
||How can I test that?|
Test procedure for this should be:
Edit php.ini and set "short_open_tag = Off"
Attempt to run the code. If there are any short tags "<?" remaining, they will appear as errors.
The abbreviation "<?=" will still be allowed, so if you want to test for ( and eliminate ) those, it will require a grep or other text search.
|2018-10-29 20:18||bdmc||New Issue|
|2018-10-29 20:18||bdmc||Assigned To||=> bdmc|
|2018-10-29 22:21||Ted||Relationship added||child of 0001260|
|2018-10-30 04:59||bdmc||Note Added: 0005621|
|2018-10-30 05:00||bdmc||Note Added: 0005622|
|2018-11-02 18:05||bdmc||Note Edited: 0005621|
|2018-11-02 18:07||bdmc||Status||new => solved?|
|2018-11-02 18:07||bdmc||Description Updated|
|2018-11-02 18:07||bdmc||Note Added: 0005641|
|2018-11-02 18:09||bdmc||Note Added: 0005642|
|2018-11-02 18:10||bdmc||Note Added: 0005643|
|2018-11-02 18:11||bdmc||Status||solved? => needs review & testing|
|2018-11-02 18:16||GuKKDevel||Note Added: 0005644|
|2018-11-02 18:23||bdmc||Note Added: 0005645|
|2018-12-03 20:53||Ted||Note Added: 0005696|
|2018-12-03 21:36||bdmc||Note Added: 0005697|
|2021-12-29 21:04||L10N||Note Added: 0006089|
|2022-01-05 01:07||bdmc||Note Added: 0006091|