|
JoomlaCode
|
|
Joomla! News -
JoomlaCode
|
|
Friday, 10 February 2012 19:00 |
|
FYI
The file "libraries\joomla\cache\storage\file.php" in J1.7.x contains a fonction called lock() (lines 242 till 280). The function use a fopen statement to open the cached file. This, without first checking if the file exists.
On my development machine, Apache raise a warning in line 250 when the file doesn't exists.
Proposed solution : just add a JFile::exists().
Original code
-------------
public function lock($id, $group, $locktime){
$returning = new stdClass;
$returning->locklooped = false;
$looptime = $locktime * 10;
$path = $this->_getFilePath($id, $group);
$_fileopen = @fopen($path, "r+b");
//Replace the line above with
// if (JFile::exists($path)) $_fileopen = @fopen($path, "r+b");
if ($_fileopen) {
$data_lock = @flock($_fileopen, LOCK_EX);
} else {
$data_lock = false;
}
[...]
return $returning;
}


read full article
|
|
|
|
|
Joomla! News -
JoomlaCode
|
|
Friday, 10 February 2012 19:00 |
|
FYI
The file "libraries\joomla\cache\storage\file.php" in J1.7.x contains a fonction called lock() (lines 242 till 280). The function use a fopen statement to open the cached file. This, without first checking if the file exists.
On my development machine, Apache raise a warning in line 250 when the file doesn't exists.
Proposed solution : just add a JFile::exists().
Original code
-------------
public function lock($id, $group, $locktime){
$returning = new stdClass;
$returning->locklooped = false;
$looptime = $locktime * 10;
$path = $this->_getFilePath($id, $group);
$_fileopen = @fopen($path, "r+b");
//Replace the line above with
// if (JFile::exists($path)) $_fileopen = @fopen($path, "r+b");
if ($_fileopen) {
$data_lock = @flock($_fileopen, LOCK_EX);
} else {
$data_lock = false;
}
[...]
return $returning;
}


read full article
|
|
Joomla! News -
JoomlaCode
|
|
Friday, 10 February 2012 18:31 |
|
FYI
The file "libraries\joomla\cache\storage\file.php" in J1.7.x contains a fonction called lock() (lines 242 till 280). The function use a fopen statement to open the cached file. This, without first checking if the file exists.
On my development machine, Apache raise a warning in line 250 when the file doesn't exists.
Proposed solution : just add a JFile::exists().
Original code
-------------
public function lock($id, $group, $locktime){
$returning = new stdClass;
$returning->locklooped = false;
$looptime = $locktime * 10;
$path = $this->_getFilePath($id, $group);
$_fileopen = @fopen($path, "r+b");
//Replace the line above with
// if (JFile::exists($path)) $_fileopen = @fopen($path, "r+b");
if ($_fileopen) {
$data_lock = @flock($_fileopen, LOCK_EX);
} else {
$data_lock = false;
}
[...]
return $returning;
}


read full article
|
|
|
Joomla! News -
JoomlaCode
|
|
Friday, 10 February 2012 18:30 |
|
FYI
The file "libraries\joomla\cache\storage\file.php" in J1.7.x contains a fonction called lock() (lines 242 till 280). The function use a fopen statement to open the cached file. This, without first checking if the file exists.
On my development machine, Apache raise a warning in line 250 when the file doesn't exists.
Proposed solution : just add a JFile::exists().
Original code
-------------
public function lock($id, $group, $locktime){
$returning = new stdClass;
$returning->locklooped = false;
$looptime = $locktime * 10;
$path = $this->_getFilePath($id, $group);
$_fileopen = @fopen($path, "r+b");
//Replace the line above with
// if (JFile::exists($path)) $_fileopen = @fopen($path, "r+b");
if ($_fileopen) {
$data_lock = @flock($_fileopen, LOCK_EX);
} else {
$data_lock = false;
}
[...]
return $returning;
}


read full article
|
|
Joomla! News -
JoomlaCode
|
|
Friday, 10 February 2012 18:00 |
|
FYI
The file "libraries\joomla\cache\storage\file.php" in J1.7.x contains a fonction called lock() (lines 242 till 280). The function use a fopen statement to open the cached file. This, without first checking if the file exists.
On my development machine, Apache raise a warning in line 250 when the file doesn't exists.
Proposed solution : just add a JFile::exists().
Original code
-------------
public function lock($id, $group, $locktime){
$returning = new stdClass;
$returning->locklooped = false;
$looptime = $locktime * 10;
$path = $this->_getFilePath($id, $group);
$_fileopen = @fopen($path, "r+b");
//Replace the line above with
// if (JFile::exists($path)) $_fileopen = @fopen($path, "r+b");
if ($_fileopen) {
$data_lock = @flock($_fileopen, LOCK_EX);
} else {
$data_lock = false;
}
[...]
return $returning;
}


read full article
|
|
|
|
|
<< Start < Prev 1 2 3 4 5 6 7 8 9 10 Next > End >>
|