Sujet fermé
Note de ce sujet :
  • Moyenne : 0 (0 vote(s))
  • 1
  • 2
  • 3
  • 4
  • 5

Future Version 1.11.5 - Report des "soucis"
#25

Tiens, on reviens sur un bug du svn 8553, voici la proposition que j'avais donné en message privé à Calguy, mais auquel il n'y a eu aucun suivi.
Citation :Hi,

The removal (8553) works, but the $path still incorrect: \/

ValidRelativePath($path) is used to check if a path is valid and it is not (I think so that this function should be in Files.php and not ImageManager.php).

All functions ImageManager and $relative call fixPath().
This is the function fixPath() that corrects the path and it is what must be used.

Here are the changes I propose for this function and you will not say more, I hate windoze Wink
Code :
static function fixPath($path)
   {
      //replace \ with / if needed
      $path = str_replace('\\','/',$path);
      //append a slash to the path if it doesn't exists.      
      if(!(substr($path,-1) == '/'))
         $path .= '/';
      
      return $path;
   }

Eg: ImageManager line 325 :
Code :
function getThumbURL($relative)
   {
      $path_parts = pathinfo($relative);
      $thumbnail = $this->config['thumbnail_prefix'].$path_parts['basename'];
      //if($path_parts['dirname']=='\\') $path_parts['dirname']='/'; //no more needed with fixPath

Thanks for your attention and your great work Smile

Jean-Marc
Sujet fermé


Messages dans ce sujet

Atteindre :


Utilisateur(s) parcourant ce sujet : 1 visiteur(s)