diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 319c0b5..0000000 --- a/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -/sticky-notes-0.3.09062012.4.tar.gz -/sticky-notes-0.3.13112012.2.tar.gz -/sticky-notes-0.4.tar.gz diff --git a/0001-Add-support-for-an-URL-shortener-ur1.ca-used-by-Iden.patch b/0001-Add-support-for-an-URL-shortener-ur1.ca-used-by-Iden.patch deleted file mode 100644 index 2dfd688..0000000 --- a/0001-Add-support-for-an-URL-shortener-ur1.ca-used-by-Iden.patch +++ /dev/null @@ -1,170 +0,0 @@ -From 79c2f64b46450eca76fd307759055e5ded2cd94f Mon Sep 17 00:00:00 2001 -From: Athmane Madjoudj -Date: Sun, 14 Apr 2013 08:57:13 +0100 -Subject: [PATCH] Add support for an URL shortener (ur1.ca used by Identi.ca) - ---- - api/api_show.json | 5 +++-- - api/api_show.xml | 3 ++- - classes/class_urlshort.php | 38 ++++++++++++++++++++++++++++++++++++++ - init.php | 3 ++- - install.php | 2 +- - show.php | 6 ++++++ - skins/bootstrap/html/tpl_show.html | 3 ++- - 7 files changed, 54 insertions(+), 6 deletions(-) - create mode 100644 classes/class_urlshort.php - -diff --git a/api/api_show.json b/api/api_show.json -index d73eac1..cf2dbf8 100755 ---- a/api/api_show.json -+++ b/api/api_show.json -@@ -5,6 +5,7 @@ - "author": "[[paste_user]]", - "timestamp": "[[paste_timestamp]]", - "language": "[[paste_lang]]", -- "data": "[[paste_data]]" -+ "data": "[[paste_data]]", -+ "short_url": "[[short_url]]" - } --} -\ No newline at end of file -+} -diff --git a/api/api_show.xml b/api/api_show.xml -index 24a70c5..931bff1 100755 ---- a/api/api_show.xml -+++ b/api/api_show.xml -@@ -5,4 +5,5 @@ - [[paste_timestamp]] - [[paste_lang]] - [[paste_data]] -- -\ No newline at end of file -+ [[short_url]] -+ -diff --git a/classes/class_urlshort.php b/classes/class_urlshort.php -new file mode 100644 -index 0000000..0d83b9b ---- /dev/null -+++ b/classes/class_urlshort.php -@@ -0,0 +1,38 @@ -+ -+* Copyright (c) 2013 Athmane Madjoudj -+* All rights reserved. Do not remove this copyright notice. -+*/ -+ -+/** -+ * URL shortener using ur1.ca from Indenti.ca -+ **/ -+class URLShortener -+{ -+ public function shorten($long_url) -+ { -+ $ch = curl_init(); -+ curl_setopt($ch, CURLOPT_URL,"http://ur1.ca/"); -+ curl_setopt($ch, CURLOPT_POST, 1); -+ curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query(array('longurl' => $long_url))); -+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); -+ $result = curl_exec($ch); -+ curl_close($ch); -+ preg_match( '/

Your ur1 is: (.+)<\/a><\/p>/', $result, $match ); -+ if (!empty($match)) -+ return $match[1]; -+ else -+ return false; -+ -+ } -+} -+ -+//$u2 = new URLShortener(); -+//print $u2->shorten("http://google.com/"); -+ -+?> -diff --git a/init.php b/init.php -index 285c976..075f22a 100755 ---- a/init.php -+++ b/init.php -@@ -24,6 +24,7 @@ include_once('classes/class_skin.php'); - include_once('classes/class_api.php'); - include_once('classes/class_nav.php'); - include_once('classes/class_spamguard.php'); -+include_once('classes/class_urlshort.php'); - include_once('addons/geshi/geshi.php'); - - // We need to instantiate the GSoD class first, just in case! -@@ -88,4 +89,4 @@ if (!defined('IN_INSTALL') && !defined('IN_ADMIN')) - include_once('cron.php'); - } - --?> -\ No newline at end of file -+?> -diff --git a/install.php b/install.php -index 9536460..2f57720 100755 ---- a/install.php -+++ b/install.php -@@ -133,4 +133,4 @@ $gsod->trigger( - "the admin panel." - ); - --?> -\ No newline at end of file -+?> -diff --git a/show.php b/show.php -index 1ffa885..a31a750 100755 ---- a/show.php -+++ b/show.php -@@ -5,6 +5,7 @@ - * @license BSD License - www.opensource.org/licenses/bsd-license.php - * - * Copyright (c) 2012 Sayak Banerjee -+* Copyright (c) 2013 Athmane Madjoudj - * All rights reserved. Do not remove this copyright notice. - */ - -@@ -227,6 +228,10 @@ $code_data = (empty($mode) ? $geshi->parse_code() : htmlspecialchars($row['data' - $lang->escape($code_data); - $skin->escape($code_data); - -+// Shorten the current URL -+$url_shortener = new URLShortener(); -+$short_url = $url_shortener->shorten($nav->get_paste($row['id'], $hash, $project, true, '')); -+ - // Assign template variables - $skin->assign(array( - 'paste_id' => $row['id'], -@@ -240,6 +245,7 @@ $skin->assign(array( - 'share_title' => urlencode($lang->get('paste') . ' #' . $row['id']), - 'error_visibility' => 'hidden', - 'geshi_stylesheet' => $geshi->get_stylesheet(), -+ 'short_url' => $short_url, - )); - - // Let's output the page now -diff --git a/skins/bootstrap/html/tpl_show.html b/skins/bootstrap/html/tpl_show.html -index a58386b..c6776bc 100755 ---- a/skins/bootstrap/html/tpl_show.html -+++ b/skins/bootstrap/html/tpl_show.html -@@ -34,6 +34,7 @@ - - - -+ Shortened URL: [[short_url]] - - -


-@@ -51,4 +52,4 @@ -
-

[[error_text]]

-
-- -\ No newline at end of file -+ --- -1.8.1.4 - diff --git a/dead.package b/dead.package new file mode 100644 index 0000000..5204a84 --- /dev/null +++ b/dead.package @@ -0,0 +1 @@ +Orphaned for 6+ weeks diff --git a/sources b/sources deleted file mode 100644 index 06bd284..0000000 --- a/sources +++ /dev/null @@ -1 +0,0 @@ -c504565ba41204125f27254e95a4d15b sticky-notes-0.4.tar.gz diff --git a/sticky-notes-0.4-dont-use-eval-for-login.patch b/sticky-notes-0.4-dont-use-eval-for-login.patch deleted file mode 100644 index 3eb94ca..0000000 --- a/sticky-notes-0.4-dont-use-eval-for-login.patch +++ /dev/null @@ -1,32 +0,0 @@ -diff --git a/classes/class_auth.php b/classes/class_auth.php -index 4ca4335..72ad9a9 100644 ---- a/classes/class_auth.php -+++ b/classes/class_auth.php -@@ -46,22 +46,14 @@ function login($username, $password) - { - global $config, $db; - -- // Get authentication method -- $method = $config->auth_method; -+ // Get authentication method callback -+ $callback = array($this, "authenticate_{$config->auth_method}"); - -- // Check if the auth method is implemented -- if (method_exists($this, "authenticate_{$method}")) -+ // Execute the method if it exists -+ if (is_callable($callback)) - { -- // Create a new session - $this->create_session(); -- -- // Generate the delegate and execute the method -- $delegate = '$auth_status = $this->authenticate_' . $method . -- '("' . $username . '", "' . $password . '");'; -- eval($delegate); -- -- // Return the authentication status returned by the delegate -- return $auth_status; -+ return call_user_func($callback, $username, $password); - } - - // Method not implemented, invalidate user diff --git a/sticky-notes-0.4-fix-error-when-retrieving-last-insered-id.patch b/sticky-notes-0.4-fix-error-when-retrieving-last-insered-id.patch deleted file mode 100644 index e868d99..0000000 --- a/sticky-notes-0.4-fix-error-when-retrieving-last-insered-id.patch +++ /dev/null @@ -1,144 +0,0 @@ -diff --git a/classes/class_db.php b/classes/class_db.php -index 3a6a65a..81e741e 100755 ---- a/classes/class_db.php -+++ b/classes/class_db.php -@@ -13,7 +13,6 @@ class db - // Class wide variables - var $pdo; - var $prefix; -- var $insert_id; - var $affected_rows; - - // Function to initialize a db connection -@@ -92,11 +91,7 @@ function query($sql, $params = array(), $single = false) - return $stmt->fetchAll(PDO::FETCH_ASSOC); - } - } -- else if (strpos($sql, 'insert') === 0) -- { -- $this->insert_id = $stmt; -- } -- else if (strpos($sql, 'update') === 0 || strpos($sql, 'delete') === 0) -+ else - { - $this->affected_rows = $stmt->rowCount(); - } -@@ -109,6 +104,12 @@ function query($sql, $params = array(), $single = false) - } - } - -+ // Gets the last inserted ID -+ function insert_id($column) -+ { -+ return $this->pdo->lastInsertId($column); -+ } -+ - // Gets the database size - function get_size() - { -diff --git a/classes/class_nav.php b/classes/class_nav.php -index 3228d23..1399ab2 100755 ---- a/classes/class_nav.php -+++ b/classes/class_nav.php -@@ -18,7 +18,7 @@ function __construct() - { - $this->rewrite_on = $this->check_rewrite(); - } -- -+ - // Check if mod_rewrite is enabled or not - function check_rewrite() - { -@@ -44,7 +44,7 @@ function get($nav_key, $project = '', $page = 1, $age = '') - $base = $core->current_uri(); - - $arg_project = !empty($project) ? '?project=' . $project : '?'; -- $arg_page = $page > 1 ? "&page={$page}" : ""; -+ $arg_page = $page > 1 ? "&page={$page}" : ""; - $arg_age = !empty($age) ? "&age={$age}" : ""; - - $rewrite_base = $core->current_uri() . (!empty($project) ? "~{$project}/" : ""); -@@ -97,7 +97,7 @@ function get($nav_key, $project = '', $page = 1, $age = '') - function get_paste($paste_id, $paste_key, $hash, $project, $format = '') - { - global $core, $config; -- -+ - try - { - // Determine whether to use ID or key -@@ -109,20 +109,20 @@ function get_paste($paste_id, $paste_key, $hash, $project, $format = '') - { - $key = $paste_id; - } -- -+ - if ($this->rewrite_on) - { - $url = $core->current_uri() . (!empty($project) ? "~{$project}/" : "") . -- "{$key}/" . -- (!empty($hash) ? "{$hash}/" : "") . -- (!empty($format) ? "{$format}/" : ""); -+ "{$key}/" . -+ (!empty($hash) ? "{$hash}/" : "") . -+ (!empty($format) ? "{$format}/" : ""); - } - else - { - $url = $core->current_uri() . "show.php?id={$key}" . -- (!empty($hash) ? "&hash={$hash}" : "") . -- (!empty($project) ? "&project={$project}" : "") . -- (!empty($format) ? "&mode={$format}" : ""); -+ (!empty($hash) ? "&hash={$hash}" : "") . -+ (!empty($project) ? "&project={$project}" : "") . -+ (!empty($format) ? "&mode={$format}" : ""); - } - - return $url; -diff --git a/index.php b/index.php -index fc88607..3240581 100755 ---- a/index.php -+++ b/index.php -@@ -23,7 +23,7 @@ - $mode = $core->variable('mode', ''); - $time = time(); - $skip_insert = false; --$db->insert_id = 0; -+$new_id = 0; - - if (empty($project)) - { -@@ -173,15 +173,18 @@ - ':hash' => $hash, - ':ip' => $core->remote_ip() - )); -+ -+ // Get the last inserted paste ID -+ $new_id = $db->insert_id('id'); - } - - // Address API requests - if ($mode == 'xml' || $mode == 'json') - { -- if ($db->insert_id) -+ if ($new_id) - { - $skin->assign(array( -- 'paste_id' => $config->url_key_enabled ? "p{$url_key}" : $db->insert_id, -+ 'paste_id' => $config->url_key_enabled ? "p{$url_key}" : $new_id, - 'paste_hash' => $private ? $hash : '', - )); - -@@ -199,10 +202,10 @@ - } - else - { -- if ($db->insert_id) -+ if ($new_id) - { - $hash_arg = ($private || $password) ? $hash : ''; -- $url = $nav->get_paste($db->insert_id, $url_key, $hash_arg, $project); -+ $url = $nav->get_paste($new_id, $url_key, $hash_arg, $project); - - if (!$password) - { diff --git a/sticky-notes-fix-login-username-xss.patch b/sticky-notes-fix-login-username-xss.patch deleted file mode 100644 index 2ce6b1f..0000000 --- a/sticky-notes-fix-login-username-xss.patch +++ /dev/null @@ -1,18 +0,0 @@ ---- admin/login.php.orig 2012-06-19 21:37:26.606807091 -0100 -+++ admin/login.php 2012-06-19 21:38:29.380814750 -0100 -@@ -44,7 +44,7 @@ - { - $banner_type = 'error'; - $banner_visibility = 'visible'; -- $banner_text = preg_replace('/\_\_user\_\_/', $username, $lang->get('invalid_login')); -+ $banner_text = preg_replace('/\_\_user\_\_/', htmlentities($username), $lang->get('invalid_login')); - } - } - -@@ -72,4 +72,4 @@ - $skin->title($lang->get('admin_login') . ' • ' . $lang->get('site_title')); - echo $skin->output(false, false, true); - --?> -\ No newline at end of file -+?> diff --git a/sticky-notes-fix-project-xss.patch b/sticky-notes-fix-project-xss.patch deleted file mode 100644 index f5a80cc..0000000 --- a/sticky-notes-fix-project-xss.patch +++ /dev/null @@ -1,19 +0,0 @@ ---- init.php.orig 2012-11-16 14:02:47.737621181 -0100 -+++ init.php 2012-11-16 14:03:49.680340099 -0100 -@@ -67,11 +67,11 @@ - unset($url); - } - --// Change project name to lower case --if (isset($_GET['project'])) $_GET['project'] = strtolower($_GET['project']); --if (isset($_POST['project'])) $_POST['project'] = strtolower($_POST['project']); --if (isset($_GET['paste_project'])) $_GET['paste_project'] = strtolower($_GET['paste_project']); --if (isset($_POST['paste_project'])) $_POST['paste_project'] = strtolower($_POST['paste_project']); -+// Change project name to lower case and escape it -+if (isset($_GET['project'])) $_GET['project'] = htmlspecialchars(strtolower($_GET['project'])); -+if (isset($_POST['project'])) $_POST['project'] = htmlspecialchars(strtolower($_POST['project'])); -+if (isset($_GET['paste_project'])) $_GET['paste_project'] = htmlspecialchars(strtolower($_GET['paste_project'])); -+if (isset($_POST['paste_project'])) $_POST['paste_project'] = htmlspecialchars(strtolower($_POST['paste_project'])); - - // Set up the db connection - $db->connect(); diff --git a/sticky-notes-fix-rss-uri-with-proxy.patch b/sticky-notes-fix-rss-uri-with-proxy.patch deleted file mode 100644 index f405d6f..0000000 --- a/sticky-notes-fix-rss-uri-with-proxy.patch +++ /dev/null @@ -1,30 +0,0 @@ -diff -ru sticky-notes.orig/classes/class_core.php sticky-notes/classes/class_core.php ---- sticky-notes.orig/classes/class_core.php 2012-10-12 21:58:07.510498928 -0100 -+++ sticky-notes/classes/class_core.php 2012-10-12 21:58:59.946486810 -0100 -@@ -147,7 +147,18 @@ - function base_uri() - { - $protocol = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 'https' : 'http'; -- $uri = $protocol . '://' . $_SERVER['HTTP_HOST'] . $this->path(); -+ -+ if (isset($_SERVER['HTTP_X_FORWARDED_HOST'])) { -+ $hostname = $_SERVER['HTTP_X_FORWARDED_HOST']; -+ } -+ elseif (isset($_SERVER['HTTP_HOST'])) { -+ $hostname = $_SERVER['HTTP_HOST']; -+ } -+ else { -+ $hostname = "unknown_host"; -+ } -+ -+ $uri = $protocol . '://' . $hostname . $this->path(); - - return $uri; - } -@@ -220,4 +231,4 @@ - } - } - --?> -\ No newline at end of file -+?> diff --git a/sticky-notes-unbundle-php-geshi.patch b/sticky-notes-unbundle-php-geshi.patch deleted file mode 100644 index 154e054..0000000 --- a/sticky-notes-unbundle-php-geshi.patch +++ /dev/null @@ -1,49 +0,0 @@ -diff -ru sticky-notes-master.orig/init.php sticky-notes-master/init.php ---- sticky-notes-master.orig/init.php 2013-04-14 10:13:06.634372031 +0100 -+++ sticky-notes-master/init.php 2013-04-14 10:10:49.755089332 +0100 -@@ -25,7 +25,7 @@ - include_once('classes/class_nav.php'); - include_once('classes/class_spamguard.php'); - include_once('classes/class_urlshort.php'); --include_once('addons/geshi/geshi.php'); -+include_once('geshi.php'); - - // We need to instantiate the GSoD class first, just in case! - $gsod = new gsod(); -@@ -52,7 +52,7 @@ - } - - // Define macros --define('GESHI_LANG_PATH', $core->base_uri() . '/addons/geshi/geshi/'); -+define('GESHI_LANG_PATH', $core->base_uri() . '/usr/share/php/geshi/'); - - // Before we do anything, let's add a trailing slash - // We skip this for admin links -diff -ru sticky-notes-master.orig/list.php sticky-notes-master/list.php ---- sticky-notes-master.orig/list.php 2013-04-14 10:07:33.740688215 +0100 -+++ sticky-notes-master/list.php 2013-04-14 10:11:39.674192189 +0100 -@@ -104,8 +104,8 @@ - $geshi = new GeSHi($row['data'], $row['language']); - $geshi->enable_line_numbers(GESHI_FANCY_LINE_NUMBERS, 2); - $geshi->set_header_type(GESHI_HEADER_DIV); -- $geshi->set_line_style('background: #f7f7f7; text-shadow: 0px 1px #fff; padding: 1px;', -- 'background: #fbfbfb; text-shadow: 0px 1px #fff; padding: 1px;'); -+ //$geshi->set_line_style('background: #f7f7f7; text-shadow: 0px 1px #fff; padding: 1px;', -+ // 'background: #fbfbfb; text-shadow: 0px 1px #fff; padding: 1px;'); - $geshi->set_overall_style('word-wrap:break-word;'); - - // Generate the data -diff -ru sticky-notes-master.orig/show.php sticky-notes-master/show.php ---- sticky-notes-master.orig/show.php 2013-04-14 10:13:06.636372035 +0100 -+++ sticky-notes-master/show.php 2013-04-14 10:11:18.302148118 +0100 -@@ -210,8 +210,8 @@ - $geshi = new GeSHi($row['data'], $row['language']); - $geshi->enable_line_numbers(GESHI_FANCY_LINE_NUMBERS, 2); - $geshi->set_header_type(GESHI_HEADER_DIV); --$geshi->set_line_style('background: #f7f7f7; text-shadow: 0px 1px #fff; padding: 1px;', -- 'background: #fbfbfb; text-shadow: 0px 1px #fff; padding: 1px;'); -+//$geshi->set_line_style('background: #f7f7f7; text-shadow: 0px 1px #fff; padding: 1px;', -+// 'background: #fbfbfb; text-shadow: 0px 1px #fff; padding: 1px;'); - $geshi->set_overall_style('word-wrap:break-word;'); - - // Generate the data diff --git a/sticky-notes-unbundle-php-libs.patch b/sticky-notes-unbundle-php-libs.patch deleted file mode 100644 index 95e356c..0000000 --- a/sticky-notes-unbundle-php-libs.patch +++ /dev/null @@ -1,43 +0,0 @@ -diff -ru sticky-notes-0.4/classes/class_email.php sticky-notes-0.4.unbundled/classes/class_email.php ---- sticky-notes-0.4/classes/class_email.php 2013-07-12 20:12:48.000000000 +0100 -+++ sticky-notes-0.4.unbundled/classes/class_email.php 2013-07-13 01:45:09.393153764 +0100 -@@ -20,7 +20,7 @@ - global $config, $core; - - // Referene the SwiftMailer library -- require_once "{$core->root_dir}addons/swiftmailer/swift_required.php"; -+ require_once "Swift/swift_required.php"; - - // Create the Transport - $transport = Swift_SmtpTransport::newInstance($config->smtp_host, $config->smtp_port); -diff -ru sticky-notes-0.4/classes/class_skin.php sticky-notes-0.4.unbundled/classes/class_skin.php ---- sticky-notes-0.4/classes/class_skin.php 2013-07-12 20:12:48.000000000 +0100 -+++ sticky-notes-0.4.unbundled/classes/class_skin.php 2013-07-13 01:31:35.274153764 +0100 -@@ -274,7 +274,7 @@ - // Instantiates GeSHi with default settings - function geshi($code, $language) - { -- require_once "addons/geshi/geshi.php"; -+ require_once "geshi.php"; - - $geshi = new GeSHi($code, $language); - $geshi->enable_line_numbers(GESHI_FANCY_LINE_NUMBERS, 2); -@@ -465,4 +465,4 @@ - } - } - --?> -\ No newline at end of file -+?> -diff -ru sticky-notes-0.4/list.php sticky-notes-0.4.unbundled/list.php ---- sticky-notes-0.4/list.php 2013-07-12 20:12:48.000000000 +0100 -+++ sticky-notes-0.4.unbundled/list.php 2013-07-13 03:09:37.798153764 +0100 -@@ -10,7 +10,7 @@ - - // Invoke required files - include_once('init.php'); --include_once('addons/geshi/geshi.php'); -+include_once('geshi.php'); - - // Collect some data - $project = $core->variable('project', ''); diff --git a/sticky-notes-use-free-url-shortener.patch b/sticky-notes-use-free-url-shortener.patch deleted file mode 100644 index 6cbc8f0..0000000 --- a/sticky-notes-use-free-url-shortener.patch +++ /dev/null @@ -1,68 +0,0 @@ -diff -ru sticky-notes-0.4.unbundled/shorten.php sticky-notes-0.4.url-short-patch/shorten.php ---- sticky-notes-0.4.unbundled/shorten.php 2013-07-12 20:12:48.000000000 +0100 -+++ sticky-notes-0.4.url-short-patch/shorten.php 2013-07-13 07:11:00.025153764 +0100 -@@ -5,6 +5,7 @@ - * @license BSD License - www.opensource.org/licenses/bsd-license.php - * - * Copyright (c) 2013 Sayak Banerjee -+* Copyright (c) 2013 Athmane Madjoudj - * All rights reserved. Do not remove this copyright notice. - */ - -@@ -15,15 +16,9 @@ - $paste_id = $core->variable('id', ''); - $project = $core->variable('project', ''); - $hash = $core->variable('hash', 0); --$api_url = "https://www.googleapis.com/urlshortener/v1/url?key={$config->google_api_key}"; -+$api_url = "http://ur1.ca/"; - $is_key = false; - --// We need the google API key for this to work --if (empty($config->google_api_key)) --{ -- die("ERROR"); --} -- - // Prepare the paste ID for use - if (!empty($paste_id)) - { -@@ -88,32 +83,19 @@ - - // Now that we know the paste exists, generate the paste URL - $paste_url = $nav->get_paste($row['id'], $row['urlkey'], $hash, $project); -- - // Create cURL - $ch = curl_init(); --curl_setopt($ch, CURLOPT_URL, $api_url); --curl_setopt($ch, CURLOPT_POST, true); --curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(array("longUrl" => $paste_url))); --curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type: application/json")); -+curl_setopt($ch, CURLOPT_URL,"http://ur1.ca/"); -+curl_setopt($ch, CURLOPT_POST, 1); -+curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query(array('longurl' => $paste_url))); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); --curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); -- --// Execute the post - $result = curl_exec($ch); -- --// Close the connection - curl_close($ch); -- --// Parse the response --$response = json_decode($result, true); -- --if (isset($response['id'])) --{ -- die($response['id']); --} -+preg_match( '/

Your ur1 is: (.+)<\/a><\/p>/', $result, $match ); -+if (!empty($match)) -+ die($match[1]); - else --{ - die("ERROR"); --} -+ - - ?> diff --git a/sticky-notes.conf b/sticky-notes.conf deleted file mode 100644 index 7749f24..0000000 --- a/sticky-notes.conf +++ /dev/null @@ -1,72 +0,0 @@ -Alias /sticky-notes "/usr/share/sticky-notes" - - - - # ACL for Apache 2.4 - - Require local - - - # ACL for Apache 2.2 - - Order Deny,Allow - Deny from all - Allow from 127.0.0.1 - Allow from ::1 - - - # URL rewriting - - # Tell PHP that rewrite rules are available - SetEnv HTTP_MOD_REWRITE On - - # Rewrite rules - RewriteEngine on - - RewriteBase /sticky-notes - - # Setup links - RewriteRule ^install/?$ install.php [NC] - RewriteRule ^upgrade/?$ upgrade.php [NC] - - # Documentation links - RewriteRule ^doc/([a-z]+)/?$ doc.php?cat=$1 [NC] - RewriteRule ^~([a-z.]+)/doc/([a-z]+)/?$ doc.php?project=$1&cat=$2 [NC] - - # Home page links - RewriteRule ^~([a-z.]+)/?$ index.php?project=$1 [NC] - RewriteRule ^~([a-z.]+)/api/([a-z]+)/?$ index.php?project=$1&mode=$2 [NC] - - # Paste list, trending and RSS - RewriteRule ^all/?$ list.php [NC] - RewriteRule ^api/([a-z]+)/all/?$ list.php?mode=$1 [NC] - RewriteRule ^~([a-z.]+)/all/?$ list.php?project=$1 [NC] - RewriteRule ^~([a-z.]+)/api/([a-z]+)/all/?$ list.php?project=$1&mode=$2 [NC] - RewriteRule ^all/([0-9]+)/?$ list.php?page=$1 [NC] - RewriteRule ^api/([a-z]+)/all/([0-9]+)/?$ list.php?mode=$1&page=$2 [NC] - RewriteRule ^~([a-z.]+)/all/([0-9]+)/?$ list.php?project=$1&page=$2 [NC] - RewriteRule ^~([a-z.]+)/api/([a-z]+)/all/([0-9]+)/?$ list.php?project=$1&mode=$2&page=$3 [NC] - RewriteRule ^trending/([a-z]+)/?$ list.php?trending=1&age=$1 [NC] - RewriteRule ^~([a-z.]+)/trending/([a-z]+)/?$ list.php?project=$1&trending=1&age=$2 [NC] - RewriteRule ^trending/?$ list.php?trending=1 [NC] - RewriteRule ^~([a-z.]+)/trending/?$ list.php?project=$1&trending=1 [NC] - RewriteRule ^rss/?$ list.php?rss=1 [NC] - RewriteRule ^~([a-z.]+)/rss/?$ list.php?project=$1&rss=1 [NC] - - # General links - RewriteRule ^([0-9]+|p[0-9a-zA-Z]{8})/?$ show.php?id=$1 [NC] - RewriteRule ^~([a-z.]+)/([0-9]+|p[0-9a-zA-Z]{8})/?$ show.php?project=$1&id=$2 [NC] - RewriteRule ^([0-9]+|p[0-9a-zA-Z]{8})/([a-z|A-Z]+)/?$ show.php?id=$1&mode=$2 [NC] - RewriteRule ^~([a-z.]+)/([0-9]+|p[0-9a-zA-Z]{8})/([a-z|A-Z]+)/?$ show.php?project=$1&id=$2&mode=$3 [NC] - RewriteRule ^api/([a-z|A-Z]+)/([0-9]+|p[0-9a-zA-Z]{8})/?$ show.php?mode=$1&id=$2 [NC] - RewriteRule ^~([a-z.]+)/api/([a-z|A-Z]+)/([0-9]+|p[0-9a-zA-Z]{8})/?$ show.php?project=$1&mode=$2&id=$3 [NC] - RewriteRule ^([0-9]+|p[0-9a-zA-Z]{8})/([0-9]+)/?$ show.php?id=$1&hash=$2 [NC] - RewriteRule ^~([a-z.]+)/([0-9]+|p[0-9a-zA-Z]{8})/([0-9]+)/?$ show.php?project=$1&id=$2&hash=$3 [NC] - RewriteRule ^([0-9]+|p[0-9a-zA-Z]{8})/([0-9]+)/([a-z|A-Z]+)/?$ show.php?id=$1&hash=$2&mode=$3 [NC] - RewriteRule ^~([a-z.]+)/([0-9]+|p[0-9a-zA-Z]{8})/([0-9]+)/([a-z|A-Z]+)/?$ show.php?project=$1&id=$2&hash=$3&mode=$4 [NC] - RewriteRule ^api/([a-z|A-Z]+)/([0-9]+|p[0-9a-zA-Z]{8})/([0-9]+)/?$ show.php?mode=$1&id=$2&hash=$3 [NC] - RewriteRule ^~([a-z.]+)/api/([a-z|A-Z]+)/([0-9]+|p[0-9a-zA-Z]{8})/([0-9]+)/?$ show.php?project=$1&mode=$2&id=$3&hash=$4 [NC] - RewriteRule ^api/([a-z|A-Z]+)/([0-9]+|p[0-9a-zA-Z]{8})/([0-9]+)/(.*)$ show.php?mode=$1&id=$2&hash=$3&password=$4 [NC] - RewriteRule ^~([a-z.]+)/api/([a-z|A-Z]+)/([0-9]+|p[0-9a-zA-Z]{8})/([0-9]+)/(.*)$ show.php?project=$1&mode=$2&id=$3&hash=$4&password=$5 [NC] - - diff --git a/sticky-notes.spec b/sticky-notes.spec deleted file mode 100644 index fc91a04..0000000 --- a/sticky-notes.spec +++ /dev/null @@ -1,171 +0,0 @@ -Summary: Sticky notes is a free and open source paste-bin application -Name: sticky-notes -Version: 0.4 -Release: 20%{?dist} -License: BSD -URL: https://github.com/sayakb/sticky-notes - -# Use the following commands to generate the tarball -# wget https://github.com/sayakb/sticky-notes/releases/tag/VERSION -Source0: sticky-notes-%{version}.tar.gz -Source1: sticky-notes.conf -Patch0: sticky-notes-unbundle-php-libs.patch -Patch1: sticky-notes-use-free-url-shortener.patch -Patch2: sticky-notes-0.4-dont-use-eval-for-login.patch -Patch3: sticky-notes-0.4-fix-error-when-retrieving-last-insered-id.patch -BuildArch: noarch -Requires: httpd -Requires: php, php-geshi, php-pdo, php-swiftmailer - -%description -Sticky notes is a free and open source paste-bin application. - -%prep -%setup -q -%patch0 -p1 -%patch1 -p1 -%patch2 -p1 -%patch3 -p1 -%build - -%install -mkdir -p ${RPM_BUILD_ROOT}%{_datadir}/%{name} -install -m 0644 -D -p %{SOURCE1} ${RPM_BUILD_ROOT}%{_sysconfdir}/httpd/conf.d/sticky-notes.conf - -# Remove exec perms on files -find . -type f -exec chmod -x {} \; - -# Remove bundled php-geshi -rm -rf addons/geshi -rm -rf addons/swiftmailer - -# Remove non-required dirs -rm -f lighttpd.conf -rm -rf cache testing -cp -pr * ${RPM_BUILD_ROOT}%{_datadir}/%{name} -mkdir ${RPM_BUILD_ROOT}%{_sysconfdir}/sticky-notes -cp config.sample.php ${RPM_BUILD_ROOT}%{_sysconfdir}/sticky-notes/config.php -ln -s ../../../etc/sticky-notes/config.php ${RPM_BUILD_ROOT}%{_datadir}/%{name}/config.php -mv install.php ${RPM_BUILD_ROOT}%{_sysconfdir}/sticky-notes/ -ln -sf ../../../etc/sticky-notes/install.php ${RPM_BUILD_ROOT}%{_datadir}/%{name}/install.php - -%files -%config(noreplace) %{_sysconfdir}/httpd/conf.d/sticky-notes.conf -%config(noreplace) %{_sysconfdir}/%{name}/config.php -%config(noreplace) %{_sysconfdir}/%{name}/install.php -%dir %{_sysconfdir}/%{name} -%{_datadir}/%{name} -%doc LICENSE -%doc README* -%doc VERSION - -%changelog -* Sat Jul 23 2022 Fedora Release Engineering - 0.4-20 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild - -* Sat Jan 22 2022 Fedora Release Engineering - 0.4-19 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild - -* Fri Jul 23 2021 Fedora Release Engineering - 0.4-18 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild - -* Wed Jan 27 2021 Fedora Release Engineering - 0.4-17 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild - -* Wed Jul 29 2020 Fedora Release Engineering - 0.4-16 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild - -* Fri Jan 31 2020 Fedora Release Engineering - 0.4-15 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild - -* Sat Jul 27 2019 Fedora Release Engineering - 0.4-14 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild - -* Sun Feb 03 2019 Fedora Release Engineering - 0.4-13 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild - -* Sat Jul 14 2018 Fedora Release Engineering - 0.4-12 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild - -* Fri Feb 09 2018 Fedora Release Engineering - 0.4-11 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild - -* Thu Jul 27 2017 Fedora Release Engineering - 0.4-10 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild - -* Sat Feb 11 2017 Fedora Release Engineering - 0.4-9 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild - -* Fri Apr 01 2016 Athmane Madjoudj 0.4-8 -- Fix php-swiftmailer dep - -* Fri Feb 05 2016 Fedora Release Engineering - 0.4-7 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild - -* Fri Jun 19 2015 Fedora Release Engineering - 0.4-6 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild - -* Sun Jun 08 2014 Fedora Release Engineering - 0.4-5 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild - -* Tue Aug 06 2013 Athmane Madjoudj 0.4-4 -- Depend on pdo instead of mysql -- Add a patch to fix a login issue -- Add a patch to fix a error when retrieving last insered id -- Misc specfile cleanup - -* Sun Aug 04 2013 Fedora Release Engineering - 0.4-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild - -* Sat Jul 13 2013 Athmane Madjoudj 0.4-2 -- Patch to use free URL shortener ur1.ca instead of Google's goo.gl. - -* Sat Jul 13 2013 Athmane Madjoudj 0.4-1 -- Update to 0.4 -- Drop upstreamed patches -- Unbundle new libs -- Simplify the specfile. - -* Sun Apr 14 2013 Athmane Madjoudj 0.3.13112012.2-1 -- Drop upstreamed patches -- Update spec (url change / download method) -- Add support for url shortening - -* Fri Feb 15 2013 Fedora Release Engineering - 0.3.09062012.4-11 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild - -* Fri Nov 16 2012 Athmane Madjoudj 0.3.09062012.4-10 -- Fix some XSS issues. - -* Tue Oct 30 2012 Athmane Madjoudj 0.3.09062012.4-9 -- Make sticky-notes.conf compatible with both httpd 2.4.x and 2.2.x. - -* Fri Oct 12 2012 Athmane Madjoudj 0.3.09062012.4-8 -- Fix hostname issue in rss URLs when reverse proxy is used. - -* Fri Jul 20 2012 Athmane Madjoudj 0.3.09062012.4-7 -- Remove exec perms on files - -* Fri Jul 20 2012 Athmane Madjoudj 0.3.09062012.4-6 -- Remove defattr to avoid bug #481363. -- Remove clean section - -* Tue Jun 19 2012 Athmane Madjoudj 0.3.09062012.4-5 -- Add a patch to fix XSS issue in username parameter at login page. - -* Thu Jun 14 2012 Athmane Madjoudj 0.3.09062012.4-4 -- Fix version number - -* Wed Jun 13 2012 Athmane Madjoudj 20120507git-3 -- Move install to config since it requires modification - -* Thu Jun 07 2012 Athmane Madjoudj 20120507git-2 -- Remove mysql-server dep -- Update to latest upstream version which includes security patch from #810928 -- Unbundle php-geshi -- Add a config file to make sticky-notes installable -- Add php-mysql as requirement - -* Sat Apr 07 2012 david - 20120407git-1 -- First packaged -