Skip to content

Commit

Permalink
Closing out the 'test-php-7' feature branch and merging back to devel…
Browse files Browse the repository at this point in the history
…op (#420)

* Fixed #171 Used mysqli procedural methods instead of mysql methods.
This is a quick fix to make OpenCATS compatible with PHP7.

* Updated mysql extension in docker config

* Fix insecure SMTP (#357)

A past phpmailer update changed to assume to use TLS even if its not enabled. This breaks insecure SMTP connections.

* Fix deprecated PHP4-style constructors (#358)

In some cases the file name implies it's for use with
PHP4 which probably doesn't work anymore. I changed
those too so there isn't noise in php7cc output

* Gate set_magic_quotes_runtime calls

Function was removed in PHP 7. Versions of PHP where
this functionality exists are theoretically not supported
and these calls could be removed entirely instead of
placed behind function_exists() checks

* Validate emails with filter_var() instead of eregi()

The ereg functions were removed in PHP 7. In this
specific use case filter_var() seems like a better
solution than migrating to a preg regex.

* Replace ereg functions with preg functions

erege functions were removed in PHP 7. FPDF has
the same patch upstream; artichow doesn't appear to
have been updated upstream.

* Use explode() instead of split()

split() was removed in PHP 7. Code was simply splitting
on different single character delimiters so using
explode() instead works fine.

* Don't combine `&` and `new` operators

This is a syntax error in PHP 7. It's been deprecated
for a long time so this change probably has no impact
on behavior

* Updated issue template to be more specific

* Update issue_template.md

* config file for the ProBot no-response bot

add the tag more-information-required to issues, if no response then will auto-close in 14 days.

* Update no-response.yml

* Updated test data for MySQL;
- strict mode compliant (now the default), and;
- added in candidate_tag tables to MySQL table structure

Installer does not error now when you select the demonstration data.

* Revert "Updated test data for MySQL;"

This reverts commit 2ce655a.

* Update modules/settings/SettingsUI.php

Co-Authored-By: gohanman <andy@gohanman.com>

* $co$conn is presumably a typo

* Correct mysqli_select_db argument order

* Missing paren in mysqli refactor

* Use MYSQLI_ASSOC consistently

* Update travis.yml for php 7.3 checks exclusively

* revised composer.json to require php v7

* Fix the PHP7 build in travis (#419)

* Rename composer.lock to ~composer.lock

* revert custom php image to generic

* Update .travis.yml

* Update .travis.yml

* revert custom php image

* Update docker-compose-test.yml

* Update docker-compose.yml

* Update docker-compose.yml

* Update docker-compose.yml

* Update docker-compose-test.yml

* Update docker-compose-test.yml

* Update docker-compose.yml

* Update docker-compose.yml

* Update docker-compose-test.yml

* Update docker-compose.yml

* Update docker-compose-test.yml

* Rename ~composer.lock to composer.lock

* Update .travis.yml

* Update .travis.yml

* pointed to russh dockerhub image for php 7.2

* update travis to use php 7.2

* Rename composer.lock to composer.lock_OFF

* tracking composer.lock for php 7.2

* updated target for php to be 7.2-fpm-alpine

* fixed typos

* remove redundant filew

* test fix for travis build errors

* simple rename php5 -> php7 in user instructions

* quick update to address XXE vulnerability

* New set of fixes for PHP 7.2 (#429)

* Updated PHPMailer to support PHP 7.2
    - PHPMailer 5.2 is no longer supported.
    - Legacy PHPMailer, which was under /lib didn't support PHP 7 best practices.
    - Removed /lib/PHPMailer directory.
    - Updated /lib/Mailer.php to support the new PHPMailer v6.
    - Updated code to support PHPMailer v6.
    - Tested the work locally and works fine.

* Resolved mysqli_error() handling by leveraging provided and tested PHP library function utilities.
- Where mysqli_connect was verified, I simplified and replaced error handling with with mysqli_connect_errno() and mysqli_connect_error().
- Where query request was verified, I simplified and replaced error handling with queryResult->connect_errno() and queryResult->connect_error().

* Added .DS_Store file in .gitignore
- Specified common Mac OS specific .DS_Store file to be ignored by git.

* Added codacy/coverage vendor library to the project's Composer dev dependencies list.

* Resolved issue with non-static method calls, as such:
- Corrected DatabaseSearch's fulltextDecode() and fulltextEncord() methods' signatures to be static.
- Corrected Contacts' getDepartmentIDByName() method call. Since, it was used differently multiple places.

* Resolved issue related to innaccessible property, as such:
- Reinforced query result object property existance check with isset().

* Resolved issue around referencing a non-existing scope property, as such:
- Replaced $sql with $this to correctly access class properties.

* Artichow - Resolved graph generation issue with PHP 7.2
- Label.class.php was complaining about count() param (texts) not being an array. Variable value needed to be verified prior the call to count().
- Label.class.php and Axis.class.php were complaining about function name was malformed for eval() to handle. microtime() needed to be carefully handled.

* Updated .gitignore to dismiss /vendor folder, which get generated by composer.

* Sphinx Search fixes for PHP 7.2
- Resolved deprecated create_function() by replacing with closure/anonymous function in Search.php.
- Resolved count() complaining about $this->_rs not being an array in Search.php on line 2091.
- Resolved by creating sphinx.conf to support newer Sphinx 2.2.4+ features.
- Resolved by creating the missing required folders for Sphinx use.
  • Loading branch information
RussH authored Sep 29, 2019
1 parent 88b2929 commit 76c3041
Show file tree
Hide file tree
Showing 130 changed files with 1,552 additions and 13,735 deletions.
9 changes: 9 additions & 0 deletions .github/no-response.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Configuration for probot-no-response - https://github.com/probot/no-response

# Number of days of inactivity before an Issue is closed for lack of response
daysUntilClose: 14
# Label requiring a response
responseRequiredLabel: more-information-required
# Comment to post when closing an Issue for lack of response. Set to `false` to disable
closeComment: >
This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please re-open the issue if you have or find the answers we need so that we can investigate further.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,7 @@ docker/data/*
docker/persist/*
vendor/*
attachments/*
temp/*
temp/*
# Ignore Mac DS_Store files
.DS_Store
/vendor/
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ before_install:

language: php
php:
- 5.6
- 7.2

script:
- composer install
Expand Down
4 changes: 3 additions & 1 deletion QueueCLI.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@
/* Make sure we aren't getting screwed over by magic quotes. */
if (get_magic_quotes_runtime())
{
set_magic_quotes_runtime(0);
if (function_exists('set_magic_quotes_runtime')) {
set_magic_quotes_runtime(0);
}
}
if (get_magic_quotes_gpc())
{
Expand Down
4 changes: 3 additions & 1 deletion ajax.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@
/* Make sure we aren't getting screwed over by magic quotes. */
if (get_magic_quotes_runtime())
{
set_magic_quotes_runtime(0);
if (function_exists('set_magic_quotes_runtime')) {
set_magic_quotes_runtime(0);
}
}
if (get_magic_quotes_gpc())
{
Expand Down
8 changes: 6 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,20 @@
"name": "OpenCATS/OpenCATS",
"require-dev": {
"behat/behat": "~3.0.4",
"phpunit/phpunit": "5.4.*",
"phpunit/phpunit": "^7",
"behat/mink": "^1.7",
"behat/mink-extension": "dev-master",
"behat/mink-goutte-driver": "^1.2",
"behat/mink-selenium2-driver": "^1.3",
"ckeditor/ckeditor": "4.5.11"
"ckeditor/ckeditor": "4.5.11",
"codacy/coverage": "^1.4"
},
"autoload": {
"psr-4": {
"OpenCATS\\": "src/OpenCATS/"
}
},
"require": {
"phpmailer/phpmailer": "^6.0"
}
}
Loading

0 comments on commit 76c3041

Please sign in to comment.