Coder Social home page Coder Social logo

Comments (6)

tannerjcox avatar tannerjcox commented on June 23, 2024

@tienhsu, what did you do to fix this?

from captcha.

Zhenjas avatar Zhenjas commented on June 23, 2024

I have same problem, please tell how to fix this problem?

from captcha.

stevejobsii avatar stevejobsii commented on June 23, 2024

@tienhsu how can you fix this problem thanks!

from captcha.

stevejobsii avatar stevejobsii commented on June 23, 2024

@Zhenjas can you fix this promblem right now?

from captcha.

tienhsu avatar tienhsu commented on June 23, 2024

@tannerjcox @stevejobsii @Zhenjas found the php file in window is format utf8 with bom, just remove BOM format.

from captcha.

tienhsu avatar tienhsu commented on June 23, 2024

you can remove BOM with the following code:

public function CheckBomFile()
{
global $auto;
set_time_limit(1000);
if (isset($_GET['dir'])) { //Set the scan Directory
$basedir = $_GET['dir'];
} else {
$basedir = './../app/';
}
$auto = 1;
self::checkdir($basedir);
}
function checkdir($basedir)
{
if ($dh = opendir($basedir)) {
while (($file = readdir($dh)) !== false) {
if ($file != '.' && $file != '..') {
if (!is_dir($basedir . "/" . $file)) {
echo "filename: $basedir/$file " . self::checkBOM("$basedir/$file") . "
";
} else {
$dirname = $basedir . "/" . $file;
self::checkdir($dirname);
}
}
}
closedir($dh);
}
}
function checkBOM($filename)
{
global $auto;
$contents = file_get_contents($filename);
$charset[1] = substr($contents, 0, 1);
$charset[2] = substr($contents, 1, 1);
$charset[3] = substr($contents, 2, 1);
if (ord($charset[1]) == 239 && ord($charset[2]) == 187 && ord($charset[3]) == 191) {
if ($auto == 1) {
$rest = substr($contents, 3);
self::rewrite($filename, $rest);
return ("<font color="red">BOM found, automatically removed.");
} else {
return ("<font color="red">BOM found.");
}
} else
return ("BOM Not Found.");
}
function rewrite($filename, $data)
{
$filenum = fopen($filename, "w");
flock($filenum, LOCK_EX);
fwrite($filenum, $data);
fclose($filenum);
}

from captcha.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.