Phpcms V9 is currently the largest number of domestic use of an open source free CMS system, it is because of his free sex, open source, and its own functional relatively strong, so many webmaster friends of the pro, as well as many companies like. Phpcms also in order to improve the procedural loopholes, the official staff will regularly release some of the program patches, let users use. Prevent some special groups, through the loopholes of the program to attack other people's website. But this update phpcms v9, found that the site backstage upload thumbnail, there will be unable to upload the phenomenon, the browser prompts undefined errors, after the test on the one hand, found this error, only some Firefox core browser will appear, IE, 360 This kind of IE core browser uploads everything normal. What is the cause of this, we pass the program to check why the background can not upload thumbnails, and the undefined error occurred.
First, Phpcms V9 backstage Unable to upload thumbnail image processing method
First open the Web program path, PHPCMS---modules----attachment----attachments.php file, find 50 lines in attachments.php file---53 lines of code, here is a procedure to determine whether to log in, we delete this paragraph is ok.
By deleting a very simple paragraph, you will be able to solve similar Firefox core browser, the background can not upload thumbnail image error. Next we detailed analysis why this sentence, will lead to the background can not upload thumbnails, and if you encounter the program above the error, but also through the following methods to analyze, must learn to use flexibly, the program is dead, and our programmer's thinking is flexible.
Note: If you are not interested in why you cannot upload thumbnail errors, the following can be skipped!
Second, phpcms V9 background can not upload the cause of the thumbnail image analysis
Now that we know the reason for this, let's see why this is the phrase that caused the thumbnail to be uploaded.
if (Isset ($_post[' Dosubmit ')) {//Determine if the Submit button is clicked
Determine if you are logged in
if (Empty ($this->userid)) {//If Useid is empty, exit directly. ($this refers to the class itself, which is defined by the attachments class in the constructor. )
Exit (' 0 ');
}
Since it is determined that the UserID is empty, then we can not upload thumbnails, it must be judged to be empty. Let's take a look at the $this->userid output.
As you can see, the output here is 1, which means that $this->userid is 1, and 1 is definitely not empty. So how did the exit phenomenon come about? Let's change another method to test and see
if (Empty ($this->userid)) {
Exit (' 0 ');
}
Whether this sentence has been carried out.
Determine if you are logged in
if (Empty ($this->userid)) {
Echo ';
Exit (' 0 ');
} else{
Echo ';
}
:
We see that the program does execute and jump out of the action. It seems that the Firefox core browser or "1" as the empty to deal with, so caused, phpcms V9 in the use of Firefox core browser, the background can not upload the phenomenon of thumbnails.
PHPCMS V9 Upgrade Background Unable to upload thumbnail image cause analysis