When managing data, there will be a preview of test data or validator binary file.
But in PHP7 the prefiew of test data text file or problem.conf text file is not shown.
After my test it is caused by file_get_contents() when passing offset with -1.
It is strange that the manual on php.net in Chinese the default of $offset is -1,
but in English the default of $offset is 0. Use -1 will get nothing, 0 instead is fine.
The commit also change uojFilePreview() that can also be used as viewing binary file.
For backwards compatibility, we just set text as the default file type and no need to specify.
When printing the table of Judgement Failed items at super-manage, there is nothing shown.
It caused by using echoSubmissionsList(), arguments that 3 passed but exactly 4 expected.
So add the missing argument, and let the result hidden because we select an exact result.
Also, because of the typo of "Judgement", there will be nothing shown if
only fixed too few arguments. This commit changes it too.
After we changed the detection of the real httpHost value, the token check will fail when register.
A long time ago we just simply added "Session_Start();" at the beginning of uoj/1/app/index.php.
It temporally solved the problem but caused another series of issues that we can't see outside.
There is also a session_start() when executing Session::init() at importing app/libs/uoj-lib.php.
So, when we add one more "Session_Start();" it will execute this one more time, just cause warning:
> session_name(): Cannot change session name when session is active
> PHP Warning: ini_set(): A session is active. You cannot change the session module's ini settings at this time
And, the session name and session path, session domain will not be set so may cause other problems.
The reason is that using UOJContext::httpHost() as web hostname when default, it will add the port at the end.
When using IP the validateIP() will return false, or using domain with port the cookie domain will be set wrongly.
As a result the register process throws out the "Expired" error and refuses to register, and other uses token will fail too.
We made it cut out the port when setting cookie domain, and also changed the style of UOJContext::httpHost() to make it easier to read.
With this problem known and solved the "Session_Start();" in index.php will also say bye-bye, and there will be no multiple session_start()s.
NOTICE: If you have set all your information to yours in .config.php, and not using address with port other than 80, you may not face this problem.
But the warning of php will consistently shown in the error log file. So kick the annoying warning information out if you are angry with this ;-)
When logout by clicking logout button on the top of /user/modify-profile link, you will be redirected to the login page.
But if you login immediately then you will get the login page again and loop.
It is caused by an address checking error. Now try to fix.
Update base system to Ubuntu 18.04.
.htaccess file's session path changed correctly.
Add gnupg install choice, due to base system has no gpg support.
Set DEBIAN_FRONTEND to noninteractive in order to prevent tzdata stuck.
Change Dockerfile's verion and buanch checkout method, in order to save space.
Fix mysql conf when not restart service and the database can't import judger info.
Change install.sh, support PHP7.2, update libv8 repo to artful, with missing php-mbstring.
The old JDK distfile mirrors are deprecated, changed to official.sed modded to get the latest jdk8.
BREAKING CHANGE: Ubuntu 14/16 users shouln't execute this script, due to config files and packages not the same.
In order to support PHP7, change the way to operate database. PHP7
removed the mysql extension, so the old way to operate database is
not usable. This commit use a new way to operate database.
BREAKING CHANGE: the way to operate database has changed.