Skip to content

Commit

Permalink
Merge pull request #818 from Joomla-Bible-Study/development
Browse files Browse the repository at this point in the history
  • Loading branch information
bcordis authored Feb 16, 2021
2 parents 5041c2e + 7f97d35 commit 34d1d23
Show file tree
Hide file tree
Showing 134 changed files with 3,179 additions and 2,313 deletions.
67 changes: 67 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
branches: [ development, master ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ development ]
schedule:
- cron: '28 2 * * 6'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
language: [ 'javascript' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
# Learn more:
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed

steps:
- name: Checkout repository
uses: actions/checkout@v2

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
37 changes: 37 additions & 0 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: PHP Composer

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Validate composer.json and composer.lock
run: composer validate

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v2
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Install dependencies
if: steps.composer-cache.outputs.cache-hit != 'true'
run: composer install --prefer-dist --no-progress --no-suggest

# Add a test script to composer.json, for instance: "test": "vendor/bin/phpunit"
# Docs: https://getcomposer.org/doc/articles/scripts.md

# - name: Run test suite
# run: composer run-script test
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,8 @@ build/reports/jdepend-pyramid.svg
build/reports/jdepend.xml
build/reports/phpcs-checkstyle.xml
build/reports/project-size.txt
/libraries/vendor/
/libraries/vendor/*
composer.lock
/.php_cs.cache
!/package-lock.json
media/css/site/biblestudy.css
4 changes: 1 addition & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,8 @@ env:
matrix:
fast_finish: true
include:
- php: 7.2
- php: 7.4
env: INSTALL_APCU="yes" INSTALL_MEMCACHE="no"
- php: 7.3
env: INSTALL_APCU="yes" INSTALL_MEMCACHE="no" INSTALL_MEMCACHED="no"

services:

Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Status
| Code | Branch | Version | Release Date | Joomla Version |
|--------------------------------------------------------------------------------------------------------------------------------------------------------|-------------|---------|--------------|----------------|
| [![](https://travis-ci.com/Joomla-Bible-Study/Joomla-Bible-Study.svg?branch=development)](https://travis-ci.com/Joomla-Bible-Study/Joomla-Bible-Study) | Development | 9.3.0 | TBD | 3.8+ |
| [![](https://travis-ci.com/Joomla-Bible-Study/Joomla-Bible-Study.svg?branch=master)](https://travis-ci.com/Joomla-Bible-Study/Joomla-Bible-Study) | Master | 9.2.3 | June 21, 2020 | 3.8+ |
| [![](https://travis-ci.com/Joomla-Bible-Study/Joomla-Bible-Study.svg?branch=master)](https://travis-ci.com/Joomla-Bible-Study/Joomla-Bible-Study) | Master | 9.2.4 | Feb 15, 2021 | 3.8+ |

*NOTE:* The master branch will always reflect the current, released stable version. Only bug fixes and minor updates should be applied to the master branch. New features are to be introduced into the development branch only.

Expand All @@ -20,12 +20,12 @@ Contributing
------------
We appreciate contributions in various capacities, below are some ways that you can contribute to this project

###Setup
### Setup
1. [Fork this repository.][fork]
2. Load dev dependencies with [Composer][composer]: `php composer.phar install --dev`
3. [Set up your dev environment][setup]

###Development
### Development
1. [Create a topic branch.][branch]
2. Implement your feature or bug fix.
3. If you implemented a new feature or added an extra functionality, create/update unit tests for that feature
Expand All @@ -39,10 +39,10 @@ We appreciate contributions in various capacities, below are some ways that you
Please **make sure to make specific contributions** when submitting pull requests. For example, if fixing bugs across multiple features of the component, create a branch for each fix, and submit a separate pull request for each fix separately, instead of fixing everything in `master`, and then just trying to pull your `master` branch into `Joomla-Bible-Study:master`.


###Translation
### Translation
The language files periodically need to be updated as the component matures. To submit changes ot add new languages, follow the same procedures as above in order to submit a [pull][pr] request.

###Testing
### Testing
For every major release, we prefer to have an approximate 2 week testing window. If you would like to help in testing and giving us feedback on the most recent versions of the component, let us know

[fork]: http://help.github.com/fork-a-repo/
Expand Down
14 changes: 14 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Security Policy

## Supported Versions

| Version | Supported |
| ------- | ------------------ |
| 9.1.x | :white_check_mark: |
| 7.0.x | :x: |
| 8.0.x | :white_check_mark: |
| < 6.x | :x: |

## Reporting a Vulnerability

Info coming soon.
43 changes: 28 additions & 15 deletions admin/addons/addon.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
// No Direct Access
defined('_JEXEC') or die;

JLoader::discover('JBSM', BIBLESTUDY_PATH_ADMIN_ADDON . '/servers/', 'true', 'true');

/**
* Abstract Server class
*
Expand All @@ -25,10 +27,28 @@ abstract class JBSMAddon
*/
protected $xml = null;

/**
* Name of Add-on
*
* @var string
* @since 9.0.0
*/
protected $name = null;

/**
* Description of add-on
*
* @var string
* @since 9.0.0
*/
protected $description = null;

/**
* Config information
*
* @var string
* @since 9.0.0
*/
protected $config = null;

/**
Expand Down Expand Up @@ -91,8 +111,7 @@ public function getType()

if (!preg_match('/JBSMAddon(.*)/i', get_class($this), $r))
{
// @TODO Changed to a localized exception
throw new Exception(JText::sprintf('JBS_CMN_CANT_ADDON_CLASS_NAME', $this->type), 500);
throw new \RuntimeException(JText::sprintf('JBS_CMN_CANT_ADDON_CLASS_NAME', $this->type), 500);
}

$this->type = strtolower($r[1]);
Expand All @@ -104,7 +123,7 @@ public function getType()
/**
* Loads the addon configuration from the xml file
*
* @return bool|SimpleXMLElement
* @return boolean|SimpleXMLElement
*
* @throws Exception
* @since 9.0.0
Expand All @@ -115,7 +134,7 @@ public function getXml()

if ($path)
{
$xml = simplexml_load_file($path);
$xml = simplexml_load_string(file_get_contents($path));
}
else
{
Expand Down Expand Up @@ -145,19 +164,13 @@ public static function getInstance($type, $config = array())
jimport('joomla.filesystem.path');
$path = JPath::find(BIBLESTUDY_PATH_ADMIN . '/addons/servers/' . $type . '/', $type . '.php');

if ($path)
{
require_once $path;

if (!class_exists($addonClass))
{
JLog::add(JText::sprintf('JBS_CMN_CANT_ADDON_LOAD_CLASS_NAME', $addonClass), JLog::WARNING, 'jerror');
// Try and load missing class
JLoader::register($addonClass, $path);

return false;
}
}
else
if (!$path)
{
JLog::add(JText::sprintf('JBS_CMN_CANT_ADDON_LOAD_CLASS_NAME', $addonClass), JLog::WARNING, 'jerror');

return false;
}
}
Expand Down
11 changes: 1 addition & 10 deletions admin/addons/servers/legacy/includes/js/moxie.js
Original file line number Diff line number Diff line change
Expand Up @@ -1162,7 +1162,6 @@ define("moxie/core/utils/Env", [
Env.log = function() {

function logObj(data) {
// TODO: this should recursively print out the object in a pretty way
console.appendChild(document.createTextNode(data + "\n"));
}

Expand Down Expand Up @@ -2970,7 +2969,7 @@ define('moxie/file/FileInput', [
*/
'change',

'cancel', // TODO: might be useful
'cancel',

/**
Dispatched when mouse cursor enters file-picker area. Can be used to style element
Expand Down Expand Up @@ -5263,14 +5262,6 @@ define("moxie/xhr/XMLHttpRequest", [
}
}

/*
function _toASCII(str, AllowUnassigned, UseSTD3ASCIIRules) {
// TODO: http://tools.ietf.org/html/rfc3490#section-4.1
return str.toLowerCase();
}
*/


function _doXHR(data) {
var self = this;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ JBS_ADDON_LEGACY_BUTTON_TEXT="Button Text"
JBS_ADDON_LEGACY_BUTTON_TEXT_DESC="If you choose only a button, enter text for that button"
JBS_ADDON_LEGACY_DOWNLOAD_USE_BUTTON="Default Download Icon"
JBS_ADDON_LEGACY_DOWNLOAD_USE_BUTTON_DESC="Choose whether to use a button/icon or image for the default download icon. Button/icon overrides image choice"
JBS_ADDON_LEGACY_PARAMETERS="Default Actions"
4 changes: 2 additions & 2 deletions admin/addons/servers/local/fields/jbsmmedia.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,15 @@ class JFormFieldJBSMMedia extends JFormField
/**
* The previewWidth.
*
* @var int
* @var integer
* @since 3.2
*/
protected $previewWidth;

/**
* The previewHeight.
*
* @var int
* @var integer
* @since 3.2
*/
protected $previewHeight;
Expand Down
2 changes: 1 addition & 1 deletion admin/addons/servers/local/media.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<media>
<fields name="params">
<fieldset name="general" addfieldpath="/administrator/components/com_biblestudy/addons/servers/legacy/fields">
<fieldset name="general" addfieldpath="/administrator/components/com_biblestudy/addons/servers/local/fields">
<field name="filename"
type="plupload"
handler="upload"
Expand Down
2 changes: 1 addition & 1 deletion admin/api.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
define('JBSM_PROFILER', 0);

// Version information
define('BIBLESTUDY_VERSION', '9.2.3');
define('BIBLESTUDY_VERSION', '9.2.4');
define('BIBLESTUDY_VERSION_UPDATEFILE', 'JBS Version ' . BIBLESTUDY_VERSION);

// Default values
Expand Down
2 changes: 1 addition & 1 deletion admin/biblestudy.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

$controller = JControllerLegacy::getInstance('Biblestudy');

if ($jbsstate && $type == 'install')
if ($jbsstate && $type === 'install')
{
JBSMHelper::clearcache('admin');
JBSMHelper::clearcache('site');
Expand Down
6 changes: 5 additions & 1 deletion admin/controllers/comment.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ class BiblestudyControllerComment extends JControllerForm
public function batch($model = null)
{
// Set the model
$model = $this->getModel('Comment', '', array());
if ($model === null)
{
$model = $this->getModel('Comment', '', array());
}

// Preset the redirect
$this->setRedirect(JRoute::_('index.php?option=com_biblestudy&view=comments' . $this->getRedirectToListAppend(), false));
Expand Down Expand Up @@ -91,6 +94,7 @@ protected function allowEdit($data = array(), $key = 'id')
*/
public function getModel($name = 'Comment', $prefix = 'BiblestudyModel', $config = array('ignore_request' => true))
{
/** @var BiblestudyModelComment $model */
$model = parent::getModel($name, $prefix, array('ignore_request' => true));

return $model;
Expand Down
4 changes: 2 additions & 2 deletions admin/help/en-GB/biblestudy.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<div class="header">Proclaim Help Screen</div>
<p>All help has been moved to our documentation site:
<p>
<a href="https://www.joomlabiblestudy.org/jbs-documentation/user-guides.html" target="_blank">Find
<a href="https://www.christianwebministries.org/jbs-documentation/user-guides.html" target="_blank">Find
answers here</a><br> <a
href="https://www.joomlabiblestudy.org/forum.html" target="_blank">Also
href="https://www.christianwebministries.org/forum.html" target="_blank">Also
visit our forum</a>
</p>
Loading

0 comments on commit 34d1d23

Please sign in to comment.