Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
thorsten committed Nov 10, 2019
1 parent cdf3eb9 commit 9109876
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 20 deletions.
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@
"monolog/monolog": "1.23.0",
"abraham/twitteroauth": "^0.7.4",
"myclabs/deep-copy": "1.3.1",
"ext-json": "*"
"ext-json": "*",
"ext-xmlwriter": "*"
},
"require-dev": {
"phpunit/phpunit": "5.*",
Expand Down
5 changes: 2 additions & 3 deletions phpmyfaq/opensearch.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,20 @@
/**
* This is XML code for OpenSearch.
*
*
* @deprecated This functionality will be removed in phpMyFAQ 3.1
*
* This Source Code Form is subject to the terms of the Mozilla Public License,
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
* obtain one at http://mozilla.org/MPL/2.0/.
*
* @package phpMyFAQ
*
* @author Thorsten Rinne <[email protected]>
* @copyright 2006-2019 phpMyFAQ Team
* @license http://www.mozilla.org/MPL/2.0/ Mozilla Public License Version 2.0
*
* @link https://www.phpmyfaq.de
* @since 2006-11-19
*/

define('IS_VALID_PHPMYFAQ', null);

require __DIR__.'/src/Bootstrap.php';
Expand Down
25 changes: 14 additions & 11 deletions phpmyfaq/translate.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,24 @@
/**
* This is the page there a user can add a FAQ record translation.
*
*
*
* This Source Code Form is subject to the terms of the Mozilla Public License,
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
* obtain one at http://mozilla.org/MPL/2.0/.
*
* @package phpMyFAQ
*
* @author Matteo Scaramuccia <[email protected]>
* @copyright 2006-2019 phpMyFAQ Team
* @license http://www.mozilla.org/MPL/2.0/ Mozilla Public License Version 2.0
*
* @link https://www.phpmyfaq.de
* @since 2006-11-12
*/

use phpMyFAQ\Captcha;
use phpMyFAQ\Faq;
use phpMyFAQ\Filter;
use phpMyFAQ\Helper\CaptchaHelper;
use phpMyFAQ\Language;

if (!defined('IS_VALID_PHPMYFAQ')) {
$protocol = 'http';
if (isset($_SERVER['HTTPS']) && strtoupper($_SERVER['HTTPS']) === 'ON') {
Expand All @@ -27,15 +30,15 @@
exit();
}

$captcha = new phpMyFAQ\Captcha($faqConfig);
$captcha = new Captcha($faqConfig);
$captcha->setSessionId($sids);

if (!is_null($showCaptcha)) {
$captcha->showCaptchaImg();
exit;
}

$translationLanguage = phpMyFAQ\Filter::filterInput(INPUT_POST, 'translation', FILTER_SANITIZE_STRIPPED, $LANGCODE);
$translationLanguage = Filter::filterInput(INPUT_POST, 'translation', FILTER_SANITIZE_STRIPPED, $LANGCODE);

if (!Language::isASupportedLanguage($translationLanguage)) {
$translationLanguage = $LANGCODE;
Expand All @@ -53,17 +56,17 @@
// @todo handle the exception
}

$id = phpMyFAQ\Filter::filterInput(INPUT_GET, 'id', FILTER_VALIDATE_INT);
$categoryId = phpMyFAQ\Filter::filterInput(INPUT_GET, 'cat', FILTER_VALIDATE_INT);
$srclang = phpMyFAQ\Filter::filterInput(INPUT_GET, 'srclang', FILTER_SANITIZE_STRIPPED);
$id = Filter::filterInput(INPUT_GET, 'id', FILTER_VALIDATE_INT);
$categoryId = Filter::filterInput(INPUT_GET, 'cat', FILTER_VALIDATE_INT);
$srclang = Filter::filterInput(INPUT_GET, 'srclang', FILTER_SANITIZE_STRIPPED);

if (!is_null($id) && !is_null($srclang) && Language::isASupportedLanguage($srclang)) {
$oFaq = new phpMyFAQ\Faq($faqConfig);
$oFaq = new Faq($faqConfig);
$oFaq->getRecord($id);
$faqSource = $oFaq->faqRecord;
}

$captchaHelper = new phpMyFAQ\Helper_Captcha($faqConfig);
$captchaHelper = new CaptchaHelper($faqConfig);

// Enable/Disable WYSIWYG editor
if ($faqConfig->get('main.enableWysiwygEditorFrontend')) {
Expand Down
9 changes: 4 additions & 5 deletions phpmyfaq/writecomment.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,20 @@
/**
* Snippet for writing a comment.
*
*
*
* This Source Code Form is subject to the terms of the Mozilla Public License,
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
* obtain one at http://mozilla.org/MPL/2.0/.
*
* @package phpMyFAQ
*
* @author Thorsten Rinne <[email protected]>
* @copyright 2002-2019 phpMyFAQ Team
* @license http://www.mozilla.org/MPL/2.0/ Mozilla Public License Version 2.0
*
* @link https://www.phpmyfaq.de
* @since 2002-08-29
*/

use phpMyFAQ\Captcha;

if (!defined('IS_VALID_PHPMYFAQ')) {
$protocol = 'http';
if (isset($_SERVER['HTTPS']) && strtoupper($_SERVER['HTTPS']) === 'ON') {
Expand All @@ -27,7 +26,7 @@
exit();
}

$captcha = new phpMyFAQ\Captcha($faqConfig);
$captcha = new Captcha($faqConfig);
$captcha->setSessionId($sids);

if (!is_null($showCaptcha)) {
Expand Down

0 comments on commit 9109876

Please sign in to comment.