From 1282ea3287a9e38893da05684579e618c775e538 Mon Sep 17 00:00:00 2001 From: Nathaniel Clark Date: Thu, 14 Oct 2021 14:40:53 -0400 Subject: [PATCH 01/11] PHP 8 Support Support for PHP4 and PHP5 is dropped Convert while (list($key, $var) = each($array)) to foreach() Convert any array {} lookups to [] Upgrade libchart to 1.3 (final) Upgrade Snoopy to 2.0.0 (final) Upgrade PHPMailer to 5.2.28 (final before 6.x rewrite) Upgrade PHPThumb to 1.7.17 ( Remove earlier libchart versions. Fix many uninitialized values (fixes warnings in logs) Signed-off-by: Nathaniel Clark --- admin.php | 4 +- admin/backup/index.php | 8 +- admin/config/index.php | 21 +- admin/patch_facility/index.php | 4 +- admin/s_address_type/index.php | 8 +- admin/s_attribute_type/index.php | 33 +- admin/s_file_type/functions.php | 4 +- admin/s_item_listing_conf/functions.php | 2 +- admin/s_item_listing_conf/index.php | 6 +- admin/s_item_type/functions.php | 2 +- admin/s_item_type/index.php | 9 +- admin/s_language/index.php | 26 +- admin/s_role/functions.php | 4 +- .../InstallTableAjaxJobs.class.php | 39 +- admin/s_site_plugin/ajaxjobs.php | 6 +- admin/s_site_plugin/index.php | 10 +- admin/s_status_type/index.php | 4 +- borrow.php | 4 +- email.php | 10 +- export.php | 2 +- include/begin.inc.php | 28 +- index.php | 2 +- install.php | 16 +- item_borrow.php | 53 +- item_display.php | 22 +- item_input.php | 97 +- javascript/date.js | 2 +- lib/AdminAjaxJobs.class.php | 4 +- lib/BooleanParser.class.php | 26 +- lib/DocTypeNameSpaceXMLParser.class.php | 6 +- lib/HTML_Listing.class.php | 4 +- lib/Install_Table.class.php | 4 +- lib/ItemImportHandler.class.php | 17 +- lib/Listing.class.php | 38 +- lib/{GDImage.class.php => ODImage.class.php} | 8 +- lib/OpenDbBrowserSniffer.class.php | 6 +- lib/OpenDbSnoopy.class.php | 2 +- lib/OpenDbUpgrader.class.php | 4 +- lib/RowImportPluginHandler.class.php | 4 +- lib/SitePlugin.class.php | 8 +- lib/Snoopy.class.php | 1775 ++--- lib/StringFileHandler.class.php | 4 +- lib/TitleMask.class.php | 96 +- lib/WelcomeBlock.class.php | 4 +- lib/WrapperFileHandler.class.php | 4 +- lib/XMLImportPlugin.class.php | 5 +- lib/XMLImportPluginHandler.class.php | 2 +- lib/admin.php | 16 +- lib/announcement.php | 4 +- lib/auth.php | 75 +- lib/chart.php | 25 +- lib/chart/JPGraphStatsChart.class.php | 87 - lib/chart/LegacyStatsChart.class.php | 282 - lib/chart/PhplotStatsChart.class.php | 89 - lib/chart/StatsChart.class.php | 6 +- ...rt12.class.php => StatsLibChart.class.php} | 14 +- lib/chart/StatsLibChart11.class.php | 55 - lib/config.php | 159 +- lib/cssparser/cssparser.php | 14 +- lib/database.php | 19 +- lib/database/mysqli.inc.php | 6 +- lib/datetime.php | 34 +- lib/displayfields.php | 25 +- lib/export.php | 4 +- lib/export/CSVExportPlugin.class.php | 7 +- lib/export/MARCExportPlugin.class.php | 3 - lib/export/OpenDbExportPlugin.class.php | 3 - lib/export/XMMMovieDatabasePlugin.class.php | 8 +- lib/filecache.php | 12 +- lib/http.php | 17 +- lib/inputfields.php | 38 +- lib/install.php | 26 +- lib/item.php | 114 +- lib/item_attribute.php | 2 +- lib/item_display.php | 4 +- lib/language.php | 10 +- lib/libchart/COPYING | 525 +- lib/libchart/ChangeLog | 47 +- lib/libchart/README | 6 +- lib/libchart/classes/Axis.php | 167 - lib/libchart/classes/BarChart.php | 172 - lib/libchart/classes/Chart.php | 257 - lib/libchart/classes/Color.php | 74 - lib/libchart/classes/HorizontalChart.php | 166 - lib/libchart/classes/LineChart.php | 168 - lib/libchart/classes/PieChart.php | 375 - lib/libchart/classes/Point.php | 68 - lib/libchart/classes/Primitive.php | 59 - lib/libchart/classes/Text.php | 139 - lib/libchart/classes/VerticalChart.php | 166 - lib/libchart/classes/libchart.php | 43 + lib/libchart/classes/model/ChartConfig.php | 112 + lib/libchart/classes/model/DataSet.php | 28 + lib/libchart/classes/model/Point.php | 59 + lib/libchart/classes/model/XYDataSet.php | 56 + .../classes/model/XYSeriesDataSet.php | 76 + lib/libchart/classes/view/axis/Axis.php | 130 + lib/libchart/classes/view/axis/Bound.php | 156 + lib/libchart/classes/view/caption/Caption.php | 112 + lib/libchart/classes/view/chart/BarChart.php | 183 + lib/libchart/classes/view/chart/Chart.php | 119 + .../classes/view/chart/HorizontalBarChart.php | 230 + lib/libchart/classes/view/chart/LineChart.php | 200 + lib/libchart/classes/view/chart/PieChart.php | 264 + .../classes/view/chart/VerticalBarChart.php | 229 + lib/libchart/classes/view/color/Color.php | 99 + lib/libchart/classes/view/color/ColorSet.php | 88 + lib/libchart/classes/view/color/Palette.php | 156 + lib/libchart/classes/view/plot/Plot.php | 445 ++ .../classes/view/primitive/Padding.php | 68 + .../classes/view/primitive/Primitive.php | 70 + .../classes/view/primitive/Rectangle.php | 80 + lib/libchart/classes/view/text/Text.php | 129 + lib/libchart/doc/DEJAVU_LICENSE | 51 + lib/libchart/doc/GNU_GPL_V3 | 674 ++ lib/libchart/images/PoweredBy.png | Bin 0 -> 1608 bytes lib/libchart/libchart.php | 33 - .../classes/view/chart/PieChart.php | 6 +- lib/listutils.php | 25 +- lib/logging.php | 38 +- lib/menu.php | 18 +- lib/opendbmailer.class.php | 16 +- lib/parseutils.php | 59 +- lib/phpmailer/LICENSE | 502 ++ lib/phpmailer/PHPMailerAutoload.php | 49 + lib/phpmailer/VERSION | 1 + lib/phpmailer/class.phpmailer.php | 6322 +++++++++++------ lib/phpmailer/class.phpmaileroauth.php | 197 + lib/phpmailer/class.phpmaileroauthgoogle.php | 77 + lib/phpmailer/class.pop3.php | 752 +- lib/phpmailer/class.smtp.php | 2090 +++--- lib/phpmailer/get_oauth_token.php | 162 + lib/phpmailer/language/phpmailer.lang-am.php | 26 + lib/phpmailer/language/phpmailer.lang-ar.php | 27 + lib/phpmailer/language/phpmailer.lang-az.php | 26 + lib/phpmailer/language/phpmailer.lang-ba.php | 26 + lib/phpmailer/language/phpmailer.lang-be.php | 26 + lib/phpmailer/language/phpmailer.lang-bg.php | 26 + lib/phpmailer/language/phpmailer.lang-ca.php | 26 + lib/phpmailer/language/phpmailer.lang-ch.php | 26 + lib/phpmailer/language/phpmailer.lang-cs.php | 25 + lib/phpmailer/language/phpmailer.lang-da.php | 26 + lib/phpmailer/language/phpmailer.lang-de.php | 25 + lib/phpmailer/language/phpmailer.lang-el.php | 25 + lib/phpmailer/language/phpmailer.lang-en.php | 23 - lib/phpmailer/language/phpmailer.lang-eo.php | 25 + lib/phpmailer/language/phpmailer.lang-es.php | 26 + lib/phpmailer/language/phpmailer.lang-et.php | 27 + lib/phpmailer/language/phpmailer.lang-fa.php | 27 + lib/phpmailer/language/phpmailer.lang-fi.php | 27 + lib/phpmailer/language/phpmailer.lang-fo.php | 26 + lib/phpmailer/language/phpmailer.lang-fr.php | 29 + lib/phpmailer/language/phpmailer.lang-gl.php | 26 + lib/phpmailer/language/phpmailer.lang-he.php | 26 + lib/phpmailer/language/phpmailer.lang-hr.php | 26 + lib/phpmailer/language/phpmailer.lang-hu.php | 26 + lib/phpmailer/language/phpmailer.lang-id.php | 26 + lib/phpmailer/language/phpmailer.lang-it.php | 27 + lib/phpmailer/language/phpmailer.lang-ja.php | 27 + lib/phpmailer/language/phpmailer.lang-ka.php | 26 + lib/phpmailer/language/phpmailer.lang-ko.php | 26 + lib/phpmailer/language/phpmailer.lang-lt.php | 26 + lib/phpmailer/language/phpmailer.lang-lv.php | 26 + lib/phpmailer/language/phpmailer.lang-ms.php | 26 + lib/phpmailer/language/phpmailer.lang-nb.php | 25 + lib/phpmailer/language/phpmailer.lang-nl.php | 26 + lib/phpmailer/language/phpmailer.lang-pl.php | 26 + lib/phpmailer/language/phpmailer.lang-pt.php | 26 + .../language/phpmailer.lang-pt_br.php | 29 + lib/phpmailer/language/phpmailer.lang-ro.php | 26 + lib/phpmailer/language/phpmailer.lang-rs.php | 26 + lib/phpmailer/language/phpmailer.lang-ru.php | 27 + lib/phpmailer/language/phpmailer.lang-sk.php | 26 + lib/phpmailer/language/phpmailer.lang-sl.php | 26 + lib/phpmailer/language/phpmailer.lang-sv.php | 26 + lib/phpmailer/language/phpmailer.lang-tr.php | 30 + lib/phpmailer/language/phpmailer.lang-uk.php | 27 + lib/phpmailer/language/phpmailer.lang-vi.php | 26 + lib/phpmailer/language/phpmailer.lang-zh.php | 28 + .../language/phpmailer.lang-zh_cn.php | 28 + lib/phpsniff/phpSniff.class.php | 74 +- lib/phpthumb/.gitattributes | 22 + lib/phpthumb/.gitignore | 234 + lib/phpthumb/README.md | 12 + lib/phpthumb/composer.json | 28 + lib/phpthumb/fonts/readme.txt | 5 + lib/phpthumb/images/readme.txt | 4 + lib/phpthumb/index.php | 10 + lib/phpthumb/license.txt | 29 + lib/phpthumb/licenses/license.gpl-10.txt | 251 + lib/phpthumb/licenses/license.gpl-20.txt | 339 + lib/phpthumb/licenses/license.gpl-30.txt | 674 ++ lib/phpthumb/licenses/license.lgpl-30.txt | 165 + lib/phpthumb/licenses/license.mpl-20.txt | 373 + lib/phpthumb/licenses/license.ptcl.txt | 27 + lib/phpthumb/phpThumb.config.php.default | 277 + lib/phpthumb/phpThumb.php | 711 ++ lib/phpthumb/phpthumb.bmp.php | 156 +- lib/phpthumb/phpthumb.class.php | 1849 +++-- lib/phpthumb/phpthumb.filters.php | 961 ++- lib/phpthumb/phpthumb.functions.php | 389 +- lib/phpthumb/phpthumb.gif.php | 252 +- lib/phpthumb/phpthumb.ico.php | 69 +- lib/phpthumb/phpthumb.unsharp.php | 54 +- lib/rss.php | 8 +- lib/secretimage.php | 4 +- lib/site/amazon.class.php | 14 +- lib/site/amazonutils.php | 6 +- lib/site/cmbkdbt.class.php | 6 +- lib/site/dvdempire.class.php | 8 +- lib/site/dvdfr.class.php | 8 +- lib/site/emusic.class.php | 5 +- lib/site/freedb.class.php | 10 +- lib/site/gbooks.class.php | 4 +- lib/site/hminfo.class.php | 6 +- lib/site/iblist.class.php | 4 +- lib/site/imdbphp.class.php | 10 +- lib/site/mangaupdat.class.php | 4 +- lib/site/michaeld.class.php | 6 +- lib/site/mobygames.class.php | 4 +- lib/site/moviemeter.class.php | 4 +- lib/site/odbamazonecs.class.php | 18 +- lib/site/tmdb.class.php | 4 +- lib/site_plugin.php | 10 +- lib/sortutils.php | 4 +- lib/statsdata.php | 4 +- lib/theme.php | 54 +- lib/user.php | 2 +- lib/utils.php | 22 +- lib/welcome/CategoryStats.class.php | 6 +- lib/welcome/LastItemsList.class.php | 6 +- lib/welcome/WhatsNew.class.php | 12 +- lib/whatsnew.php | 37 +- lib/widgets.php | 44 +- .../support/xajaxUserFunction.inc.php | 2 +- .../plugin_layer/xajaxEventPlugin.inc.php | 2 +- .../plugin_layer/xajaxFunctionPlugin.inc.php | 2 +- .../plugin_layer/xajaxScriptPlugin.inc.php | 2 +- .../xajax_core/xajaxArgumentManager.inc.php | 3 - lib/xajax/xajax_core/xajaxRequest.inc.php | 2 +- lib/xajax/xajax_core/xajaxResponse.inc.php | 2 +- listings.php | 119 +- login.php | 3 +- quick_checkout.php | 18 +- rss.php | 6 +- search.php | 8 +- stats.php | 12 +- test/GDImageTest.php | 16 +- user_admin.php | 12 +- welcome.php | 7 +- 250 files changed, 19113 insertions(+), 9862 deletions(-) rename lib/{GDImage.class.php => ODImage.class.php} (96%) delete mode 100644 lib/chart/JPGraphStatsChart.class.php delete mode 100644 lib/chart/LegacyStatsChart.class.php delete mode 100644 lib/chart/PhplotStatsChart.class.php rename lib/chart/{StatsLibChart12.class.php => StatsLibChart.class.php} (84%) delete mode 100644 lib/chart/StatsLibChart11.class.php delete mode 100644 lib/libchart/classes/Axis.php delete mode 100644 lib/libchart/classes/BarChart.php delete mode 100644 lib/libchart/classes/Chart.php delete mode 100644 lib/libchart/classes/Color.php delete mode 100644 lib/libchart/classes/HorizontalChart.php delete mode 100644 lib/libchart/classes/LineChart.php delete mode 100644 lib/libchart/classes/PieChart.php delete mode 100644 lib/libchart/classes/Point.php delete mode 100644 lib/libchart/classes/Primitive.php delete mode 100644 lib/libchart/classes/Text.php delete mode 100644 lib/libchart/classes/VerticalChart.php create mode 100644 lib/libchart/classes/libchart.php create mode 100644 lib/libchart/classes/model/ChartConfig.php create mode 100644 lib/libchart/classes/model/DataSet.php create mode 100644 lib/libchart/classes/model/Point.php create mode 100644 lib/libchart/classes/model/XYDataSet.php create mode 100644 lib/libchart/classes/model/XYSeriesDataSet.php create mode 100644 lib/libchart/classes/view/axis/Axis.php create mode 100644 lib/libchart/classes/view/axis/Bound.php create mode 100644 lib/libchart/classes/view/caption/Caption.php create mode 100644 lib/libchart/classes/view/chart/BarChart.php create mode 100644 lib/libchart/classes/view/chart/Chart.php create mode 100644 lib/libchart/classes/view/chart/HorizontalBarChart.php create mode 100644 lib/libchart/classes/view/chart/LineChart.php create mode 100644 lib/libchart/classes/view/chart/PieChart.php create mode 100644 lib/libchart/classes/view/chart/VerticalBarChart.php create mode 100644 lib/libchart/classes/view/color/Color.php create mode 100644 lib/libchart/classes/view/color/ColorSet.php create mode 100644 lib/libchart/classes/view/color/Palette.php create mode 100644 lib/libchart/classes/view/plot/Plot.php create mode 100644 lib/libchart/classes/view/primitive/Padding.php create mode 100644 lib/libchart/classes/view/primitive/Primitive.php create mode 100644 lib/libchart/classes/view/primitive/Rectangle.php create mode 100644 lib/libchart/classes/view/text/Text.php create mode 100644 lib/libchart/doc/DEJAVU_LICENSE create mode 100644 lib/libchart/doc/GNU_GPL_V3 create mode 100644 lib/libchart/images/PoweredBy.png delete mode 100644 lib/libchart/libchart.php create mode 100644 lib/phpmailer/LICENSE create mode 100644 lib/phpmailer/PHPMailerAutoload.php create mode 100644 lib/phpmailer/VERSION create mode 100644 lib/phpmailer/class.phpmaileroauth.php create mode 100644 lib/phpmailer/class.phpmaileroauthgoogle.php create mode 100644 lib/phpmailer/get_oauth_token.php create mode 100644 lib/phpmailer/language/phpmailer.lang-am.php create mode 100644 lib/phpmailer/language/phpmailer.lang-ar.php create mode 100644 lib/phpmailer/language/phpmailer.lang-az.php create mode 100644 lib/phpmailer/language/phpmailer.lang-ba.php create mode 100644 lib/phpmailer/language/phpmailer.lang-be.php create mode 100644 lib/phpmailer/language/phpmailer.lang-bg.php create mode 100644 lib/phpmailer/language/phpmailer.lang-ca.php create mode 100644 lib/phpmailer/language/phpmailer.lang-ch.php create mode 100644 lib/phpmailer/language/phpmailer.lang-cs.php create mode 100644 lib/phpmailer/language/phpmailer.lang-da.php create mode 100644 lib/phpmailer/language/phpmailer.lang-de.php create mode 100644 lib/phpmailer/language/phpmailer.lang-el.php delete mode 100755 lib/phpmailer/language/phpmailer.lang-en.php create mode 100644 lib/phpmailer/language/phpmailer.lang-eo.php create mode 100644 lib/phpmailer/language/phpmailer.lang-es.php create mode 100644 lib/phpmailer/language/phpmailer.lang-et.php create mode 100644 lib/phpmailer/language/phpmailer.lang-fa.php create mode 100644 lib/phpmailer/language/phpmailer.lang-fi.php create mode 100644 lib/phpmailer/language/phpmailer.lang-fo.php create mode 100644 lib/phpmailer/language/phpmailer.lang-fr.php create mode 100644 lib/phpmailer/language/phpmailer.lang-gl.php create mode 100644 lib/phpmailer/language/phpmailer.lang-he.php create mode 100644 lib/phpmailer/language/phpmailer.lang-hr.php create mode 100644 lib/phpmailer/language/phpmailer.lang-hu.php create mode 100644 lib/phpmailer/language/phpmailer.lang-id.php create mode 100644 lib/phpmailer/language/phpmailer.lang-it.php create mode 100644 lib/phpmailer/language/phpmailer.lang-ja.php create mode 100644 lib/phpmailer/language/phpmailer.lang-ka.php create mode 100644 lib/phpmailer/language/phpmailer.lang-ko.php create mode 100644 lib/phpmailer/language/phpmailer.lang-lt.php create mode 100644 lib/phpmailer/language/phpmailer.lang-lv.php create mode 100644 lib/phpmailer/language/phpmailer.lang-ms.php create mode 100644 lib/phpmailer/language/phpmailer.lang-nb.php create mode 100644 lib/phpmailer/language/phpmailer.lang-nl.php create mode 100644 lib/phpmailer/language/phpmailer.lang-pl.php create mode 100644 lib/phpmailer/language/phpmailer.lang-pt.php create mode 100644 lib/phpmailer/language/phpmailer.lang-pt_br.php create mode 100644 lib/phpmailer/language/phpmailer.lang-ro.php create mode 100644 lib/phpmailer/language/phpmailer.lang-rs.php create mode 100644 lib/phpmailer/language/phpmailer.lang-ru.php create mode 100644 lib/phpmailer/language/phpmailer.lang-sk.php create mode 100644 lib/phpmailer/language/phpmailer.lang-sl.php create mode 100644 lib/phpmailer/language/phpmailer.lang-sv.php create mode 100644 lib/phpmailer/language/phpmailer.lang-tr.php create mode 100644 lib/phpmailer/language/phpmailer.lang-uk.php create mode 100644 lib/phpmailer/language/phpmailer.lang-vi.php create mode 100644 lib/phpmailer/language/phpmailer.lang-zh.php create mode 100644 lib/phpmailer/language/phpmailer.lang-zh_cn.php create mode 100644 lib/phpthumb/.gitattributes create mode 100644 lib/phpthumb/.gitignore create mode 100644 lib/phpthumb/README.md create mode 100644 lib/phpthumb/composer.json create mode 100644 lib/phpthumb/fonts/readme.txt create mode 100644 lib/phpthumb/images/readme.txt create mode 100644 lib/phpthumb/index.php create mode 100644 lib/phpthumb/license.txt create mode 100644 lib/phpthumb/licenses/license.gpl-10.txt create mode 100644 lib/phpthumb/licenses/license.gpl-20.txt create mode 100644 lib/phpthumb/licenses/license.gpl-30.txt create mode 100644 lib/phpthumb/licenses/license.lgpl-30.txt create mode 100644 lib/phpthumb/licenses/license.mpl-20.txt create mode 100644 lib/phpthumb/licenses/license.ptcl.txt create mode 100644 lib/phpthumb/phpThumb.config.php.default create mode 100644 lib/phpthumb/phpThumb.php diff --git a/admin.php b/admin.php index 94f07ad8..3459d875 100644 --- a/admin.php +++ b/admin.php @@ -67,7 +67,7 @@ _theme_header($title); // todo - this should really be in the ... - does it matter? - if ($xajax) { + if (isset($xajax)) { $xajax->printJavascript(); } @@ -92,4 +92,4 @@ // Cleanup after begin.inc.php require_once("./include/end.inc.php"); -?> \ No newline at end of file +?> diff --git a/admin/backup/index.php b/admin/backup/index.php index 8b587434..13dca4cf 100644 --- a/admin/backup/index.php +++ b/admin/backup/index.php @@ -106,13 +106,13 @@ function get_table_content($table, $crlf) { unset($HTTP_VARS['tables']); $opendb_tables_r = fetch_opendb_table_list_r(); - while (list(, $value) = each($opendb_tables_r)) { + foreach ($opendb_tables_r as $value) { $HTTP_VARS['tables'][] = $value; } } @reset($HTTP_VARS['tables']); - while (list(, $table) = @each($HTTP_VARS['tables'])) { + foreach ($HTTP_VARS['tables'] as $table) { echo $CRLF . "#" . $CRLF; echo "# " . get_opendb_lang_var('dumping_data_for_table', 'table', $table) . $CRLF; echo "#" . $CRLF . $CRLF; @@ -126,7 +126,7 @@ function get_table_content($table, $crlf) { echo ("