mirror of
https://github.com/claudehohl/Stikked.git
synced 2025-04-26 13:01:08 -05:00
Merge pull request #362 from techjwalker/patch-1
YOURLS support. Issue #358
This commit is contained in:
commit
03f89fcf64
@ -289,6 +289,16 @@ class Pastes extends CI_Model
|
|||||||
$config_yourls_url = $this->config->item('yourls_url');
|
$config_yourls_url = $this->config->item('yourls_url');
|
||||||
$config_yourls_signature = $this->config->item('yourls_signature');
|
$config_yourls_signature = $this->config->item('yourls_signature');
|
||||||
$timestamp = time();
|
$timestamp = time();
|
||||||
|
// grab title to avoid 404s in yourls
|
||||||
|
if ($this->input->post('title'))
|
||||||
|
{
|
||||||
|
$yourl_title = htmlspecialchars($this->input->post('title'));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$yourl_title = $this->config->item('unknown_title');
|
||||||
|
}
|
||||||
|
|
||||||
$prep_data = array(
|
$prep_data = array(
|
||||||
CURLOPT_URL => $config_yourls_url . 'yourls-api.php',
|
CURLOPT_URL => $config_yourls_url . 'yourls-api.php',
|
||||||
CURLOPT_RETURNTRANSFER => true,
|
CURLOPT_RETURNTRANSFER => true,
|
||||||
@ -297,6 +307,7 @@ class Pastes extends CI_Model
|
|||||||
'url' => $url,
|
'url' => $url,
|
||||||
'format' => 'simple',
|
'format' => 'simple',
|
||||||
'action' => 'shorturl',
|
'action' => 'shorturl',
|
||||||
|
'title' => $yourl_title,
|
||||||
'signature' => md5($timestamp . $config_yourls_signature) ,
|
'signature' => md5($timestamp . $config_yourls_signature) ,
|
||||||
'timestamp' => $timestamp
|
'timestamp' => $timestamp
|
||||||
)
|
)
|
||||||
@ -378,6 +389,15 @@ class Pastes extends CI_Model
|
|||||||
//use yourls
|
//use yourls
|
||||||
$config_yourls_signature = $this->config->item('yourls_signature');
|
$config_yourls_signature = $this->config->item('yourls_signature');
|
||||||
$timestamp = time();
|
$timestamp = time();
|
||||||
|
// grab title to avoid 404s in yourls
|
||||||
|
if ($this->input->post('title'))
|
||||||
|
{
|
||||||
|
$yourl_title = htmlspecialchars($this->input->post('title'));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$yourl_title = $this->config->item('unknown_title');
|
||||||
|
}
|
||||||
$prep_data = array(
|
$prep_data = array(
|
||||||
CURLOPT_URL => $config_yourls_url . 'yourls-api.php',
|
CURLOPT_URL => $config_yourls_url . 'yourls-api.php',
|
||||||
CURLOPT_RETURNTRANSFER => true,
|
CURLOPT_RETURNTRANSFER => true,
|
||||||
@ -386,6 +406,7 @@ class Pastes extends CI_Model
|
|||||||
'url' => $url,
|
'url' => $url,
|
||||||
'format' => 'simple',
|
'format' => 'simple',
|
||||||
'action' => 'shorturl',
|
'action' => 'shorturl',
|
||||||
|
'title' => $yourl_title,
|
||||||
'signature' => md5($timestamp . $config_yourls_signature) ,
|
'signature' => md5($timestamp . $config_yourls_signature) ,
|
||||||
'timestamp' => $timestamp
|
'timestamp' => $timestamp
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user