Changeset 2212 for branches


Ignore:
Timestamp:
Feb 16, 2008, 2:22:47 PM (17 years ago)
Author:
rub
Message:

Resolved issue 0000712: PWG-ERROR-VERSION on remote synchronization

Location:
branches/branch-1_7/include
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • branches/branch-1_7/include/common.inc.php

    r2202 r2212  
    33// | PhpWebGallery - a PHP based picture gallery                           |
    44// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
    5 // | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
     5// | Copyright (C) 2003-2008 PhpWebGallery Team - http://phpwebgallery.net |
    66// +-----------------------------------------------------------------------+
    77// | branch        : BSF (Best So Far)
     
    126126  'array_intersect_key', //PHP 5 >= 5.1.0RC1
    127127  'hash_hmac', //(hash) - enabled by default as of PHP 5.1.2
     128  'preg_last_error', // PHP 5 >= 5.2.0
    128129  ) as $func)
    129130{
  • branches/branch-1_7/include/functions_xml.inc.php

    r1900 r2212  
    33// | PhpWebGallery - a PHP based picture gallery                           |
    44// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
    5 // | Copyright (C) 2003-2005 PhpWebGallery Team - http://phpwebgallery.net |
     5// | Copyright (C) 2003-2008 PhpWebGallery Team - http://phpwebgallery.net |
    66// +-----------------------------------------------------------------------+
    77// | branch        : BSF (Best So Far)
    8 // | file          : $RCSfile$
     8// | file          : $Id$
    99// | last update   : $Date$
    1010// | last modifier : $Author$
     
    6666  return $attribute.'="'.htmlspecialchars($value, ENT_QUOTES).'" ';
    6767}
    68        
     68
    6969// The function getChild returns the first child
    7070// exemple : getChild( "<table><tr>XXX</tr><tr>YYY</tr></table>", "tr" )
     
    7575  $regex.= '(\s*\/>|>.*<\/'.$node.'>)/U';
    7676
    77   preg_match( $regex, $document, $out );
    78   return $out[0];
     77  if
     78    (
     79      preg_match( $regex, $document, $out )
     80      or
     81      preg_last_error() == PREG_NO_ERROR
     82    )
     83  {
     84    return $out[0];
     85  }
     86  else
     87  {
     88    die('getChild: error ['.preg_last_error().'] with preg_match function');
     89  }
    7990}
    8091
     
    90101  $regex.= '(\s*\/>|>.*<\/'.$node.'>)/U';
    91102
    92   preg_match_all( $regex, $document, $out );
    93   return $out[0];
     103  if
     104    (
     105      preg_match_all( $regex, $document, $out )
     106      or
     107      preg_last_error() == PREG_NO_ERROR
     108    )
     109  {
     110    return $out[0];
     111  }
     112  else
     113  {
     114    die('getChild: error ['.preg_last_error().'] with preg_match_all function');
     115  }
    94116}
    95        
     117
    96118// get_CodeXML places the content of a text file in a PHP variable and
    97119// return it. If the file can't be opened, returns false.
    98120function getXmlCode( $filename )
    99121{
     122  if (function_exists('ini_set'))
     123  {
     124    // limit must be growed with php5 and "big" listing file
     125    ini_set("pcre.backtrack_limit", pow(2, 32));
     126  }
     127
    100128  $file = fopen( $filename, 'r' );
    101129  if ( !$file )
Note: See TracChangeset for help on using the changeset viewer.