No longer using session_start_safe() function because it caused more
usage problems than it solved. Setting a load of new params now to give
a much better setup.
newFile now just calls newTab but with 'alsoSave' param, which is picked
up and runs saveFile, giving more power to the API
When opening a file, if it's a new tab, call createNewTab with a 'new'
param, which is picked up and if set, we don't call setPreviousFiles. We
don't want to set them on adding a new tab anyway, plus it creates an
extra process, which means the server queue gets jammed and new tabs
don't get a save action processed.
The 2 x if conditions added a security measure to avoid path traversals,
should languageBase or languageUser ever be set to something malicious
such as (eg ../../../../../../../etc/passwd)
However, it meant that the ICEcoder dir and the doc root dir paths had
to both start the same, and so be in the same location really. It was
previously a benefit to have them possibly contain different paths, but
this security point restricts this.
We can remove these 2 if conditions however and simply wrap the 2 array
values with basename(), so we take only the trailing file name and so
avoid path traversal issues.
Location shouldn't contain the dirname of the file or a loggedOut param
(with no CSRF!) - all unnecessary and causes problems
Also add a die() after the header location to go no further.
Causes file locking issues if allowed to be called from anywhere
Because we only call from index.php now, also need dirname(___FILE___)
to complete paths
configCreateDate set if 0 now on every load, not just save
14 full days setup (1296000 - 1 sec), so doesn't start by showing 13
days (and 23 hrs, 59 secs)
If configCreateDate == 0, $tRemaining is the $tPeriod
If there has been a change of language, set a bool flag for a reload
later
Save languageUser to file also on settings update
realpath checking on language file name also, dies if fails
Remote menu option is now Source
Don't hard code or pass through the adjustCursor value
shiftSim param added so we can simulate a shift key just as we do with
ctrlSim
boxSelect function added so we can draw a box on drag in the file
manager and select files. Math.abs used to always return a positive
number
Only input focus if we're not showing the trial screen, indicated by
lack of $_GET param
Only if trialBarRemaining is there should we adjust the bar length, now
also done 0.5 after load
On mouse down, up and drag, we now also call boxSelect function with
appropriate param
If we haven't just dragged a box select area, we can selectFileFolder on
click. If we have, set to false afterwards to reset
fmDragBox div added with no select properties and also added to body
If we have multiple selections, deselect to the primary selection only.
If we only have a single selection, then we comment/uncomment.
(Avoids having multiple selections, pressing Esc to clear to a single
and also unwantedly commenting/uncommenting).
REQUEST used as param may be over GET or POST (under XHR setup now) and
html_entity_decode it
fileURLPart is now fileURL and POST'd in XHR send, not part of URL to
get
file value now can be received from POST or GET (REQUEST), as we will be
passing in POST via XHR in future
html_entity_decode the value so we can have special chars
With this enabled (the default), saving a file will copy the main pane
value to the diff pane. This means you can see what changes you are
making prior to a save and also can undo changes in diff pane to see
save points and how they differ to the main pane.
newFileName needs docRoot also in path
statusArray is now statusObj
Recoding of diff handling code to work with new XHR setup and
improvements at same time re reducing use of textareas
We should indeed only output if index.php and top.iceRoot is updated
after a settings change in settings-update.php (top.docRoot only changes
if you manually change the file, in which case a reload is needed and
this is picked up again from scratch).