Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing the url of notes, and tags which start with # #10

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 9 additions & 1 deletion shaarli2twitter/shaarli2twitter.php
Expand Up @@ -86,7 +86,15 @@ function hook_shaarli2twitter_save_link($data, $conf)
// We will use an array to generate hashtags, then restore original shaare tags.
$data['tags'] = array_values(array_filter(explode(' ', $data['tags'])));
for ($i = 0; $i < count($data['tags']); $i++) {
$data['tags'][$i] = '#'. $data['tags'][$i];
if($data['tags'][$i][0] != '#') { // If the tag is already a hashtag we don't need to
$data['tags'][$i] = '#'. $data['tags'][$i];
}
}


// In case of note, we use full URL
if($data['url'][0] == '?') {
$data['url'] = index_url($_SERVER) . $data['url'];
}

$data['permalink'] = index_url($_SERVER) . '?' . $data['shorturl'];
Expand Down