Skip to content

Conversation

brainfoolong
Copy link
Contributor

Resent to main branch as noted here #244 (comment)

@brainfoolong brainfoolong changed the title Fixes PHP8 errors and several other fixes Aug 19, 2020
@williamdes
Copy link
Contributor

Fixes: #222

@nicolaasuni could you please have a look ?

@fezfez
Copy link

fezfez commented Nov 27, 2020

any news ?

@vladislavtkachenko
Copy link

someone alive?)

@brainfoolong
Copy link
Contributor Author

I can't give any information, it's now maintainers turn.

@CLAassistant
Copy link

CLAassistant commented Dec 9, 2020

CLA assistant check
All committers have signed the CLA.

@@ -1136,7 +1136,7 @@ public static function extractCSSproperties($cssdata) {
* @see setHtmlVSpace()
* @public static
*/
public static function fixHTMLCode($html, $default_css='', $tagvs='', $tidy_options='', &$tagvspaces) {
public static function fixHTMLCode($html, $default_css, $tagvs, $tidy_options, &$tagvspaces) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems a braking change

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, its not. The last Parameter was never optional, so all user code must have defined those parameters. So all code use this function have already those params.

@@ -470,7 +470,7 @@ protected function get255StateCodeword($cwpad, $cwpos) {
* Returns true if the char belongs to the selected mode
* @param $chr (int) Character (byte) to check.
* @param $mode (int) Current encoding mode.
* @return boolean true if the char is of the selected mode.
* @return bool true if the char is of the selected mode.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of fixing these barcode functions it would probably be easier to just import the new tc-lib-barcode library that is ready.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would that be a breaking change?

@@ -1136,7 +1136,7 @@ public static function extractCSSproperties($cssdata) {
* @see setHtmlVSpace()
* @public static
*/
public static function fixHTMLCode($html, $default_css='', $tagvs='', $tidy_options='', &$tagvspaces) {
public static function fixHTMLCode($html, $default_css, $tagvs, $tidy_options, &$tagvspaces) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a breaking change?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, its not. The last Parameter was never optional, so all user code must have defined those parameters. So all code use this function have already those params.

Comment on lines -6674 to -6689
$w = $w;
break;
}
case 'L': {
if ($this->rtl) {
$w = $w;
} else {
if (!$this->rtl) {
$w = $l;
}
break;
}
case 'R': {
if ($this->rtl) {
$w = $l;
} else {
$w = $w;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems another breaking change?

@@ -7779,16 +7777,16 @@ public function _destroy($destroyall=false, $preserve_objcopy=false) {
// remove all temporary files
if ($handle = @opendir(K_PATH_CACHE)) {
while ( false !== ( $file_name = readdir( $handle ) ) ) {
if (strpos($file_name, '__tcpdf_'.$this->file_id.'_') === 0) {
if (strpos($file_name, '__tcpdf_'.$this->file_id.'_') === 0 && file_exists(K_PATH_CACHE.$file_name)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

file_exists is a security issue.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you explain why, it would be interesting :)

@@ -1136,7 +1136,7 @@ public static function extractCSSproperties($cssdata) {
* @see setHtmlVSpace()
* @public static
*/
public static function fixHTMLCode($html, $default_css='', $tagvs='', $tidy_options='', &$tagvspaces) {
public static function fixHTMLCode($html, $default_css, $tagvs, $tidy_options, &$tagvspaces) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://stackoverflow.com/a/16636807/5155484

Suggested change
public static function fixHTMLCode($html, $default_css, $tagvs, $tidy_options, &$tagvspaces) {
public static function fixHTMLCode($html, $default_css = '', $tags = '', $tidy_options = '', &$tagvspaces = null) {

@williamdes
Copy link
Contributor

I think according to https://stackoverflow.com/a/16636807/5155484 it could be set to null the default parameters to not introduce bc breaks
But the default value should be checked that the code is ready for it

@williamdes
Copy link
Contributor

williamdes commented Dec 9, 2020

#293 was merged and did out-date this pull-request

@brainfoolong
Copy link
Contributor Author

Ok, i am out of this library. I did my best to help. Cya.

@ricoBolo06
Copy link

I made the change that you propose, but I still get the error with export from phpMyAdmin ( from xampp distrib / windows).
error => Deprecation Notice in .\vendor\tecnickcom\tcpdf\include\tcpdf_static.php
As export is an important function in phpMyadmin, could you tell me how we can resolve this pb ? Where we can find source ? Thank for help

@ricoBolo06
Copy link

I just reproduce the pb :

Deprecation Notice in .\vendor\twig\twig\src\Node\IncludeNode.php#25
 Required parameter $lineno follows optional parameter $only

Backtrace

.\vendor\composer\ClassLoader.php#444: include()
.\vendor\composer\ClassLoader.php#322: Composer\Autoload\includeFile(string 'D:\\7Prod\\wwwroot\\Admin\\phpMyAdmin\\vendor\\composer/../twig/twig/src/Node/IncludeNode.php')
.\vendor\twig\twig\src\TokenParser\IncludeTokenParser.php#33: Composer\Autoload\ClassLoader->loadClass(string 'Twig\\Node\\IncludeNode')
.\vendor\twig\twig\src\Parser.php#209: Twig\TokenParser\IncludeTokenParser->parse()
.\vendor\twig\twig\src\TokenParser\ForTokenParser.php#51: Twig\Parser->subparse(array)
.\vendor\twig\twig\src\Parser.php#209: Twig\TokenParser\ForTokenParser->parse()
.\vendor\twig\twig\src\Parser.php#122: Twig\Parser->subparse(
NULL,
boolean false,
)
.\vendor\twig\twig\src\Environment.php#735: Twig\Parser->parse()
.\vendor\twig\twig\src\Environment.php#793: Twig\Environment->parse()
.\vendor\twig\twig\src\Environment.php#482: Twig\Environment->compileSource()
.\vendor\twig\twig\src\Environment.php#445: Twig\Environment->loadClass(
string '__TwigTemplate_82a1bb593753cedc13c5589a395e58ea45db18d4fa2fc2fcfc27ad4d2166fb7f',
string 'database/structure/table_header.twig',
NULL,
)
.\vendor\twig\twig\src\Environment.php#423: Twig\Environment->loadTemplate(string 'database/structure/table_header.twig')
.\libraries\classes\Template.php#115: Twig\Environment->load(string 'database/structure/table_header.twig')
.\libraries\classes\Controllers\Database\DatabaseStructureController.php#727: PhpMyAdmin\Template->render(array)
.\libraries\classes\Controllers\Database\DatabaseStructureController.php#195: PhpMyAdmin\Controllers\Database\DatabaseStructureController->displayTableList()
.\db_structure.php#38: PhpMyAdmin\Controllers\Database\DatabaseStructureController->indexAction()

with phpMyAdmin Version : 4.9.7
Apache/2.4.46 (Win64) OpenSSL/1.1.1h PHP/8.0.0
Version du client de base de données : libmysql - mysqlnd 8.0.0
Extension PHP : mysqliDocumentation mbstringDocumentation
Version de PHP : 8.0.0

thank for any help,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants