Project

General

Profile

Problèmes fonctionnels #158

Bug : opac_css\classes\explnum.class.php

Added by Anonymous about 5 years ago. Updated about 5 years ago.

Status:
Fermée
Priority:
Urgent
Assignee:
Category:
OPAC - Autre (précisez)
Target version:
Start date:
10/08/2018
Due date:
% Done:

0%

Estimated time:

Description

Bonjour,

nous pensons avoir découvert un bug dans le fichier \opac_css\classes\explnum.class.php, plus particulièrement dans la méthode get_file_size():

Méthode d'origine :
public function get_file_size(){
$size = 0;
if (!$this->explnum_file_size) {
if ($this->explnum_data) {
$size = strlen($this->explnum_data);
} elseif ($this->explnum_path) {
$up = new upload_folder($this->explnum_repertoire);
$path = str_replace("//","/",$this->explnum_rep_path.$this->explnum_path.$this->explnum_nomfichier);
$path = $up->encoder_chaine($path);
$size = filesize($path);
}
$this->explnum_file_size = $size;
}

return $size;
}

Problème :
si le test $this->explnum_file_size est TRUE, la méthode rend 0

Solution proposée :
public function get_file_size(){
$size = 0;
if (!$this->explnum_file_size) {
if ($this->explnum_data) {
$size = strlen($this->explnum_data);
} elseif ($this->explnum_path) {
$up = new upload_folder($this->explnum_repertoire);
$path = str_replace("//","/",$this->explnum_rep_path.$this->explnum_path.$this->explnum_nomfichier);
$path = $up->encoder_chaine($path);
$size = filesize($path);
}
$this->explnum_file_size = $size;
} else {
$size = $this->explnum_file_size;
}

return $size;
}

Merci.

Frédéric Filée,

History

#1 Updated by Eric ROBERT about 5 years ago

Ca a déjà été corrigé dans la 5.0.5 ;-)

#2 Updated by Eric ROBERT about 5 years ago

  • Status changed from Proposé to Fermée

#3 Updated by Anonymous about 5 years ago

Salut Eric,
Dans la version 5.0.5 téléchargée depuis la Forge, le problème est toujours bien là.
La méthode rend $size qui est initialisé à 0 si $this->explnum_file_size a une valeur.
Bien cordialement,
FF.

#4 Updated by Eric ROBERT about 5 years ago

Erreur de ma part sur la version, ça a été corrigé en dev depuis longtemps, reporté en 5.0 pour la future 5.0.6.

Also available in: Atom PDF