PHP7 fixes - constructor must be named __construct()
This commit is contained in:
		
							parent
							
								
									a1c2039371
								
							
						
					
					
						commit
						87627acd61
					
				|  | @ -73,7 +73,7 @@ var $PDFVersion;         // PDF version number | ||||||
| *                               Public methods                                 * | *                               Public methods                                 * | ||||||
| *                                                                              * | *                                                                              * | ||||||
| *******************************************************************************/ | *******************************************************************************/ | ||||||
| function FPDF($orientation='P', $unit='mm', $size='A4') | function __construct($orientation='P', $unit='mm', $size='A4') | ||||||
| { | { | ||||||
| 	// Some checks
 | 	// Some checks
 | ||||||
| 	$this->_dochecks(); | 	$this->_dochecks(); | ||||||
|  |  | ||||||
|  | @ -40,7 +40,7 @@ class UFPDF extends FPDF | ||||||
| *                               Public methods                                 * | *                               Public methods                                 * | ||||||
| *                                                                              * | *                                                                              * | ||||||
| *******************************************************************************/ | *******************************************************************************/ | ||||||
| function UFPDF($orientation='P',$unit='mm',$format='A4') | function __construct($orientation='P',$unit='mm',$format='A4') | ||||||
| { | { | ||||||
|   FPDF::FPDF($orientation, $unit, $format); |   FPDF::FPDF($orientation, $unit, $format); | ||||||
| } | } | ||||||
|  | @ -266,7 +266,7 @@ function MultiCell($w,$h,$txt,$border=0,$align='J',$fill=0) | ||||||
| 		if (isset($cw[$cp[$i]])) { | 		if (isset($cw[$cp[$i]])) { | ||||||
| 			$l += $cw[$cp[$i]]; | 			$l += $cw[$cp[$i]]; | ||||||
| 		} | 		} | ||||||
| 		 | 
 | ||||||
| 		if($l>$wmax) | 		if($l>$wmax) | ||||||
| 		{ | 		{ | ||||||
| 			//Automatic line break
 | 			//Automatic line break
 | ||||||
|  | @ -624,23 +624,23 @@ function utf8_to_utf16be(&$txt, $bom = true) { | ||||||
|         while (ord($txt{$i + 1}) >= 0x80 && ord($txt{$i + 1}) < 0xC0) { ++$i; } |         while (ord($txt{$i + 1}) >= 0x80 && ord($txt{$i + 1}) < 0xC0) { ++$i; } | ||||||
|         continue; |         continue; | ||||||
|       } |       } | ||||||
|        | 
 | ||||||
|       $q = array($c); |       $q = array($c); | ||||||
|       // Fetch rest of sequence
 |       // Fetch rest of sequence
 | ||||||
|       while (ord($txt{$i + 1}) >= 0x80 && ord($txt{$i + 1}) < 0xC0) { ++$i; $q[] = ord($txt{$i}); } |       while (ord($txt{$i + 1}) >= 0x80 && ord($txt{$i + 1}) < 0xC0) { ++$i; $q[] = ord($txt{$i}); } | ||||||
|        | 
 | ||||||
|       // Check length
 |       // Check length
 | ||||||
|       if (count($q) != $s) { |       if (count($q) != $s) { | ||||||
|         $out .= "\xFF\xFD";         |         $out .= "\xFF\xFD"; | ||||||
|         continue; |         continue; | ||||||
|       } |       } | ||||||
|        | 
 | ||||||
|       switch ($s) { |       switch ($s) { | ||||||
|         case 2: |         case 2: | ||||||
|           $cp = (($q[0] ^ 0xC0) << 6) | ($q[1] ^ 0x80); |           $cp = (($q[0] ^ 0xC0) << 6) | ($q[1] ^ 0x80); | ||||||
|           // Overlong sequence
 |           // Overlong sequence
 | ||||||
|           if ($cp < 0x80) { |           if ($cp < 0x80) { | ||||||
|             $out .= "\xFF\xFD";         |             $out .= "\xFF\xFD"; | ||||||
|           } |           } | ||||||
|           else { |           else { | ||||||
|             $out .= chr($cp >> 8); |             $out .= chr($cp >> 8); | ||||||
|  | @ -652,7 +652,7 @@ function utf8_to_utf16be(&$txt, $bom = true) { | ||||||
|           $cp = (($q[0] ^ 0xE0) << 12) | (($q[1] ^ 0x80) << 6) | ($q[2] ^ 0x80); |           $cp = (($q[0] ^ 0xE0) << 12) | (($q[1] ^ 0x80) << 6) | ($q[2] ^ 0x80); | ||||||
|           // Overlong sequence
 |           // Overlong sequence
 | ||||||
|           if ($cp < 0x800) { |           if ($cp < 0x800) { | ||||||
|             $out .= "\xFF\xFD";         |             $out .= "\xFF\xFD"; | ||||||
|           } |           } | ||||||
|           // Check for UTF-8 encoded surrogates (caused by a bad UTF-8 encoder)
 |           // Check for UTF-8 encoded surrogates (caused by a bad UTF-8 encoder)
 | ||||||
|           else if ($c > 0xD800 && $c < 0xDFFF) { |           else if ($c > 0xD800 && $c < 0xDFFF) { | ||||||
|  | @ -672,14 +672,14 @@ function utf8_to_utf16be(&$txt, $bom = true) { | ||||||
|           } |           } | ||||||
|           // Outside of the Unicode range
 |           // Outside of the Unicode range
 | ||||||
|           else if ($cp >= 0x10FFFF) { |           else if ($cp >= 0x10FFFF) { | ||||||
|             $out .= "\xFF\xFD";             |             $out .= "\xFF\xFD"; | ||||||
|           } |           } | ||||||
|           else { |           else { | ||||||
|             // Use surrogates
 |             // Use surrogates
 | ||||||
|             $cp -= 0x10000; |             $cp -= 0x10000; | ||||||
|             $s1 = 0xD800 | ($cp >> 10); |             $s1 = 0xD800 | ($cp >> 10); | ||||||
|             $s2 = 0xDC00 | ($cp & 0x3FF); |             $s2 = 0xDC00 | ($cp & 0x3FF); | ||||||
|              | 
 | ||||||
|             $out .= chr($s1 >> 8); |             $out .= chr($s1 >> 8); | ||||||
|             $out .= chr($s1 & 0xFF); |             $out .= chr($s1 & 0xFF); | ||||||
|             $out .= chr($s2 >> 8); |             $out .= chr($s2 >> 8); | ||||||
|  | @ -708,10 +708,10 @@ function utf8_substr($str,$start) | ||||||
| { | { | ||||||
|   $rs = ''; |   $rs = ''; | ||||||
|   if( func_num_args() >= 3 ) { |   if( func_num_args() >= 3 ) { | ||||||
|     $end = func_get_arg( 2 );  |     $end = func_get_arg( 2 ); | ||||||
|     for ($i=$start; $i < ($start+$end); $i++) |     for ($i=$start; $i < ($start+$end); $i++) | ||||||
|       $rs .= $this->code2utf($str[$i]); |       $rs .= $this->code2utf($str[$i]); | ||||||
|      | 
 | ||||||
|   } else { |   } else { | ||||||
|     for ($i=$start; $i < count($str); $i++) |     for ($i=$start; $i < count($str); $i++) | ||||||
|       $rs .= $this->code2utf($str[$i]); |       $rs .= $this->code2utf($str[$i]); | ||||||
|  | @ -754,17 +754,17 @@ function utf8_to_codepoints($txt) { | ||||||
|         while (ord($txt{$i + 1}) >= 0x80 && ord($txt{$i + 1}) < 0xC0) { ++$i; } |         while (ord($txt{$i + 1}) >= 0x80 && ord($txt{$i + 1}) < 0xC0) { ++$i; } | ||||||
|         continue; |         continue; | ||||||
|       } |       } | ||||||
|        | 
 | ||||||
|       $q = array($c); |       $q = array($c); | ||||||
|       // Fetch rest of sequence
 |       // Fetch rest of sequence
 | ||||||
|       while (ord($txt{$i + 1}) >= 0x80 && ord($txt{$i + 1}) < 0xC0) { ++$i; $q[] = ord($txt{$i}); } |       while (ord($txt{$i + 1}) >= 0x80 && ord($txt{$i + 1}) < 0xC0) { ++$i; $q[] = ord($txt{$i}); } | ||||||
|        | 
 | ||||||
|       // Check length
 |       // Check length
 | ||||||
|       if (count($q) != $s) { |       if (count($q) != $s) { | ||||||
|         $out[] = 0xFFFD; |         $out[] = 0xFFFD; | ||||||
|         continue; |         continue; | ||||||
|       } |       } | ||||||
|        | 
 | ||||||
|       switch ($s) { |       switch ($s) { | ||||||
|         case 2: |         case 2: | ||||||
|           $cp = (($q[0] ^ 0xC0) << 6) | ($q[1] ^ 0x80); |           $cp = (($q[0] ^ 0xC0) << 6) | ($q[1] ^ 0x80); | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue