illegal string in renderinfo.php line 6

Phoca Gallery - image gallery extension
sysinfomac
Phoca Newbie
Phoca Newbie
Posts: 3
Joined: 12 Aug 2019, 18:28

illegal string in renderinfo.php line 6

Post by sysinfomac »

C'est un problème d'initialisation de variables comme dans image.php dont voici la correction trouvée sur un forum et donnée par jen.
$size = array();
/*$size = ' ';*/
la correction sur renderinfo.php est donc la suivante:
$xml_items = array();
/*$xml_items = ' ';*/
c'est quand même une belle erreur pour un développeur expérimenté=> à mettre au compte de l'inattention, un moment d'égarement avec toutes ces lignes de code à gérer
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47810
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: illegal string in renderinfo.php line 6

Post by Jan »

Hi, which version of Phoca Gallery do you use? Which is the file and line of the problematic code?

Can you paste exact error message here (including file and line where the problem occurs - to do so, you should enable debug mode in Joomla! Global Configuration)

Thank you, Jan
If you find Phoca extensions useful, please support the project
sysinfomac
Phoca Newbie
Phoca Newbie
Posts: 3
Joined: 12 Aug 2019, 18:28

Re: illegal string in renderinfo.php line 6

Post by sysinfomac »

Bonjour,
A priori c'est la version 4.2.2. c'est le fichier administrator\components\com_phocagallery\libraries\phocagallery\render\renderinfo.php dont voici le code:
<?php defined( '_JEXEC' ) or die( 'Restricted access' );
jimport('joomla.filesystem.folder');
class PhocaGalleryRenderInfo {
public static function getPhocaIc($output){ $v = PhocaGalleryRenderInfo::getPhocaVersion(); $i = str_replace('.', '',substr($v, 0, 3)); $n = '<p>&nbsp;</p>'; $l = 'h'.'t'.'t'.'p'.':'.'/'.'/'.'w'.'w'.'w'.'.'.'p'.'h'.'o'.'c'.'a'.'.'.'c'.'z'.'/'; $p = 'P'.'h'.'o'.'c'.'a'.' '.'G'.'a'.'l'.'l'.'e'.'r'.'y'; $im = 'i'.'c'.'o'.'n'.'-'.'p'.'h'.'o'.'c'.'a'.'-'.'l'.'o'.'g'.'o'.'-'.'s'.'m'.'a'.'l'.'l'.'.'.'p'.'n'.'g'; $s = 's'.'t'.'y'.'l'.'e'.'='.'"'.'t'.'e'.'x'.'t'.'-'.'d'.'e'.'c'.'o'.'r'.'a'.'t'.'i'.'o'.'n'.':'.'n'.'o'.'n'.'e'.'"'; $b = 't'.'a'.'r'.'g'.'e'.'t'.'='.'"'.'_'.'b'.'l'.'a'.'n'.'k'.'"'; $im2 = 'i'.'c'.'o'.'n'.'-'.'p'.'h'.'o'.'c'.'a'.'-'.'l'.'o'.'g'.'o'.'-'.'s'.'e'.'a'.'l'.'.'.'p'.'n'.'g'; $i = (int)$i * (int)$i; $lg = ''; if ($output != $i) { $lg .= $n; $lg .= '<div style="text-align:center">'; } if ($output == 1) { $lg .= '<a href="'.$l.'" '.$s.' '.$b.' title="'.$p.'">'. JHTML::_('image', 'media/com_phocagallery/images/'.$im, $p). '</a>'; $lg .= ' <a href="http://www.phoca.cz/" '.$s.' '.$b.' title="'.$p.'">'. $v .'</a>'; } else if ($output == 2 || $output == 3) { $lg .= '<a href="'.$l.'" '.$s.' '.$b.' title="'.$p.'">'. JHTML::_('image', 'media/com_phocagallery/images/'.$im, $p). '</a>'; } else if ($output == 4) { $lg .= ' <a href="'.$l.'" '.$s.' '.$b.' title="'.$p.'">Phoca Gallery</a>'; } else if ($output == 5) { $lg .= ' <a href="'.$l.'" '.$s.' '.$s.' '.$b.' title="'.$p.'">'.$p.' '.$v.'</a>'; } else if ($output == 6) { $lg .= ' <a href="'.$l.'" '.$s.' '.$b.' title="'.$p.'">'. JHTML::_('image', 'media/com_phocagallery/images/'.$im2, $p). '</a>'; } else if ($output == $i) { $lg .= '<!-- <a href="'.$l.'">site: www.phoca.cz | version: '.$v.'</a> -->'; } else { $lg .= '<a href="'.$l.'" '.$s.' '.$b.' title="'.$p.'">'. JHTML::_('image', 'media/com_phocagallery/images/'.$im, $p). '</a>'; $lg .= ' <a href="http://www.phoca.cz/" '.$s.' '.$b.' title="'.$p.'">'. $v .'</a>'; } if ($output != $i) { $lg .= '</div>' . $n; } return $lg; }
public static function getPhocaVersion() {
$folder = JPATH_ADMINISTRATOR .DS. 'components'.DS.'com_phocagallery';
if (JFolder::exists($folder)) { $xmlFilesInDir = JFolder::files($folder, '.xml$');
} else {
$folder = JPATH_SITE .DS. 'components'.DS.'com_phocagallery';
if (JFolder::exists($folder)) {
$xmlFilesInDir = JFolder::files($folder, '.xml$');
} else {
$xmlFilesInDir = null; }
}
$xml_items = array();
/*$xml_items = '';*/

if (count($xmlFilesInDir)) {
foreach ($xmlFilesInDir as $xmlfile) {
if ($data = JApplicationHelper::parseXMLInstallFile($folder.DS.$xmlfile))
{
foreach($data as $key => $value) { $xml_items[$key] = $value; } }
}
}
if (isset($xml_items['version']) && $xml_items['version'] != '' ) {
return $xml_items['version'];
} else {
return ''; }

}
} ?>
c'est le même problème rencotré dans administrator\components\com_phocagallery\libraries\phocagallery\image\image.php ligne 50 ou sur un forum tu as donné la solution que voici $size = array();
Bonne journée et bravo pour le travail accompli
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47810
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: illegal string in renderinfo.php line 6

Post by Jan »

Hi, you should updated to latest version which is 4.3.18

Image

Jan
If you find Phoca extensions useful, please support the project
sysinfomac
Phoca Newbie
Phoca Newbie
Posts: 3
Joined: 12 Aug 2019, 18:28

Re: illegal string in renderinfo.php line 6

Post by sysinfomac »

ok merci
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47810
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: illegal string in renderinfo.php line 6

Post by Jan »

Ok
If you find Phoca extensions useful, please support the project
Post Reply