Removal of unnecessary files. Minor corrections to the code and translation

This commit is contained in:
Krzysiek Janiczek 2024-04-25 20:47:48 +02:00
parent f55bf9eda8
commit 6690657c51
9 changed files with 25 additions and 165 deletions

View file

@ -1,4 +1,8 @@
<?php <?php
// QUrl Theme for YOURLS
// A simple theme for YOURLS built based on the Bootstrap framework.
// Author: ookris => https://github.com/ookris/QUrl
// Load functions file // Load functions file
include('qurl/functions.php'); include('qurl/functions.php');

View file

@ -1,6 +1,9 @@
<?php <?php
// Theme config file // QUrl Theme for YOURLS
// A simple theme for YOURLS built based on the Bootstrap framework.
// Author: ookris => https://github.com/ookris/QUrl
// Theme config file
// Page title // Page title
$sitetitle = 'Szybkie skracanie linków'; $sitetitle = 'Szybkie skracanie linków';
$shorttitle = 'QUrl.pl'; $shorttitle = 'QUrl.pl';
@ -24,8 +27,8 @@ $robots = 'index, nofollow';
// Google reCAPTCHA V3 // Google reCAPTCHA V3
// More info: https://developers.google.com/recaptcha // More info: https://developers.google.com/recaptcha
$recaptchaSiteKey = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'; $recaptchaSiteKey = 'xxxxxxxxxxxxxx';
$recaptchaSecretKey = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'; $recaptchaSecretKey = 'xxxxxxxxxxxxxx';
// Email send settings // Email send settings
// Sending emails using the PHPMailer library. More info: https://github.com/PHPMailer/PHPMailer // Sending emails using the PHPMailer library. More info: https://github.com/PHPMailer/PHPMailer

View file

@ -1,12 +1,11 @@
<?php <?php
// get number of links in the database // Get URLs Count for current filter, total links in DB & total clicks
require_once( dirname( __DIR__ ).'/includes/load-yourls.php' ); require_once( dirname( __DIR__ ).'/includes/load-yourls.php' );
// Variables
$table_url = YOURLS_DB_TABLE_URL; $table_url = YOURLS_DB_TABLE_URL;
$where = array('sql' => '', 'binds' => array()); $where = array('sql' => '', 'binds' => array());
// Get URLs Count for current filter, total links in DB & total clicks
list( $total_urls, $total_clicks ) = array_values( yourls_get_db_stats() ); list( $total_urls, $total_clicks ) = array_values( yourls_get_db_stats() );
if ( !empty($where['sql']) ) { if ( !empty($where['sql']) ) {
list( $total_items, $total_items_clicks ) = array_values( yourls_get_db_stats( $where ) ); list( $total_items, $total_items_clicks ) = array_values( yourls_get_db_stats( $where ) );

View file

@ -10,21 +10,6 @@
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous"> <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css"> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
<link href="/qurl/custom.css" rel="stylesheet"> <link href="/qurl/custom.css" rel="stylesheet">
<!-- Matomo -->
<script>
var _paq = window._paq = window._paq || [];
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u="//qurlpl.usermd.net/matomo/";
_paq.push(['setTrackerUrl', u+'matomo.php']);
_paq.push(['setSiteId', '1']);
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
})();
</script>
<!-- /Matomo Code -->
</head> </head>
<body> <body>

View file

@ -1,4 +1,8 @@
<?php <?php
// QUrl Theme for YOURLS
// A simple theme for YOURLS built based on the Bootstrap framework.
// Author: ookris => https://github.com/ookris/QUrl
declare(strict_types=1); declare(strict_types=1);
// Polish translation // Polish translation

View file

@ -1,4 +1,7 @@
<?php <?php
// QUrl Theme for YOURLS
// A simple theme for YOURLS built based on the Bootstrap framework.
// Author: ookris => https://github.com/ookris/QUrl
if (empty($_POST['email'])) { if (empty($_POST['email'])) {
exit('No access'); exit('No access');
@ -7,7 +10,7 @@ if (empty($_POST['email'])) {
$reportDate = date('d.m.Y H:i'); $reportDate = date('d.m.Y H:i');
$reportID = mt_rand(100000, 999999); $reportID = mt_rand(100000, 999999);
// Load qurl config file // Load config file
include('qurl/config.php'); include('qurl/config.php');
//PHPMailer Library //PHPMailer Library

View file

@ -1,4 +1,7 @@
<?php <?php
// QUrl Theme for YOURLS
// A simple theme for YOURLS built based on the Bootstrap framework.
// Author: ookris => https://github.com/ookris/QUrl
if (empty($_POST['link'])) { if (empty($_POST['link'])) {
exit('No access'); exit('No access');
@ -7,7 +10,7 @@ if (empty($_POST['link'])) {
$reportDate = date('d.m.Y H:i'); $reportDate = date('d.m.Y H:i');
$reportID = mt_rand(100000, 999999); $reportID = mt_rand(100000, 999999);
// Load qurl config file // Load config file
include('qurl/config.php'); include('qurl/config.php');
//PHPMailer Library //PHPMailer Library

View file

@ -1,141 +0,0 @@
<?php
/*
Plugin Name: U-SRV | helper file
Plugin URI: https://github.com/joshp23/YOURLS-U-SRV
Description: A universal file server for YOURLS | This is the server
Version: 2.3.4
Author: Josh Panter
Author URI: https://unfettered.net
*/
if( !defined( 'YOURLS_ABSPATH' ) ) die();
// Verify that all parameters have been set
// get access key or die
if( isset($_GET['key'])) {
$key = $_GET['key'];
} else {
die('FAIL: missing passkey');
}
// get plugin id or die
if( isset($_GET['id'])) {
$id = $_GET['id'];
} else {
die('FAIL: missing id');
}
// get file name or die
if( isset($_GET['fn'])) {
$fn = $_GET['fn'];
// strip path traversal characters - security
$fn = preg_replace('/^((\.*)(\/*))*/', '', $fn);
} else {
die('FAIL: missing filename');
}
// Do security check
// create access lock
$now = round(time()/60);
$lock = md5($now . $id);
// set a cookie to help with javascript calls
$cname = "usrv_" . $id;
setcookie($cname,$now, 0, "/");
// check access key
if($lock !== $key) die('FAIL: bad access key');
/*
*
* ID
*
* Check sender and file store location
*
* To add your plugin or script, add a new case below
* with an arbitrary ID and file store location and send
* the same ID in the GET request.
*
* Ex. In this example the cache location is stored in the DB
* as a YOURLS option. Note the default option name structure:
*
* case 'ID_VALUE':
* $path = yourls_get_option('ID_VALUE_usrv_loc');
* break;
*
* Ex. In this example the filepath is just stored here:
*
* case 'ID_VALUE':
* $path = '/path/to/your/files/');
* break;
*/
$path = yourls_get_option('usrv_cache_loc');
if($path == null) $path = dirname(YOURLS_ABSPATH)."/YOURLS_CACHE";
$dir = yourls_get_option( $id.'_usrv_dir' );
switch ($id) {
case 'usrv_files':
$path = $path.'/fu';
break;
case 'snapshot':
if($dir == null) $dir = 'preview';
$path = $path.'/'.$dir;
break;
case 'snapshot-alt':
$path = YOURLS_PLUGINDIR.'/snapshot/assets';
break;
case 'iqrcodes':
if($dir == null) $dir = 'qr';
$path = $path .'/'. $dir;
break;
default:
$path = $path.'/'.$dir;
}
// Work with the file
$file = $path . '/' . $fn;
// Compare result path to conf path - 2nd security check for path traversal
$loc = pathinfo($file, PATHINFO_DIRNAME);
if( $loc != $path ) die('FAIL: malformed request');
// verify file
if (is_file($file)) { // if the file exists at this location
$type = pathinfo($fn, PATHINFO_EXTENSION); // then get the file extention type
} else {
die('FAIL: file not found'); // or die
}
/*
* Mime Types
*
* Header information must beset explicitly.
*
* Add new file types by using the following format:
*
* case "": $ctype=""; break;
*
*/
switch( $type ) {
case "jpg":
$ctype="image/jpeg";
break;
case "png":
$ctype="image/png";
break;
case "svg":
$ctype="image/svg+xml";
break;
case "zip":
$ctype="application/zip";
break;
default:
$ctype="pronk";
break;
}
if($ctype == "pronk") die('file type not supported, please check your configuration');
header('Content-type: ' . $ctype); // send the correct headers
header('Expires: 0'); // .
header('Content-Length: ' . filesize($file)); // .
ob_clean(); // .
flush(); // .
readfile($file); // with the file data
exit;
?>