stuff in plugins.
Then I moved some files:
src/validate.php -> include/validate.php
src/load_prefs.php -> include/load_prefs.php
src/options_personal.php -> include/options/personal.php
src/options_display.php -> include/options/display.php
src/options_folder.php -> include/options/folder.php
Basically, the concept here is that src/ should ONLY contain files that
actually get called from the web browser as a php script directly. All
of these files do not really contain functions or anything (so the
functions/ directory did not really make sense), but were more strictly
include files.
Of course, the name functions for a directory is bad organization, IMHO,
anyhow. I guess class would fall in the same category. Oh well, some of
that might get fixed someday.
So, new rule. Only put it in src/ if it gets called directly.
That was really sort of an unwritten rule before. However, since it was
never really enforced or officialized, things got sloppy.
I think I have everything fixed in the CORE with this traumatic moves. I
am sure all of the plugins will be broken. Oh well, the error messages
should be pretty loud and easy enough to fix.
1. Wrap all operands of a complex expression with parentheses.
For instance:
if ($bob == 'foo' || $bob == 'bar') {
is wrong. Do this instead:
if (($bob == 'foo') || ($bob == 'bar')) {
2. Carefully decide between pre and post incrementation. If it
does not matter, always choose pre because it is technically
more efficient. For instance:
for ($i = 0; $i < $count; $i++) {
is wrong. Do this instead:
for ($i = 0; $i < $count; ++$i) {
3. Classes should be named in style like this:
MessageHeader
Rfc8222Header
etc. When there is an acronym at the beginning, treat it
like a word - do NOT captitalize each letter of the acronym.
4. Put each class in a seperate file named ClassName.class.php.
Related classes can be put in one directory and then included
in a main include file.
Second, big changes with mime.class.php here. And I don't think I broke
anything. (Sounds like famous last words, eh?)
magicHTML)
Maybe this is the wrong fix but in case of iframes tags with a cid link to an
internal entity it's possible that stupid users download attached virus
entities because the iframe src pointed to a filename with .scr, .exe, .bat or
other extension. This patch only allow the following hardcoded save extensions:
gif, jpeg, jpg, png, bmp.
To do:
notify user in case of invalid extensions.
totally remove iframes because I think in most cases (virus) they are unsave.
sqimap_run_command. Explanation: if we request for a single fetch (not a
list) we shouldn't look for extra fetch lines because this stops the
processing in case of body entities with * a001 fetch lines.
Later we can glue the 2 functions together if we add information to
sqimap_read_data_list about the nature of the call (list or not)