ci2 #7
4 changed files with 15 additions and 7 deletions
|
@ -1,3 +1,4 @@
|
|||
---
|
||||
name: lint
|
||||
run-name: lint is launched by ${{ github.actor }}
|
||||
on: [push]
|
||||
|
@ -7,12 +8,12 @@ jobs:
|
|||
name: lint
|
||||
steps:
|
||||
- run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
|
||||
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by Gitea!"
|
||||
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by Forgejo!"
|
||||
- run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
|
||||
- name: Check out repository code
|
||||
uses: actions/checkout@v4
|
||||
- name: Install linters using Composer
|
||||
run: |
|
||||
run: |
|
||||
export COMPOSER_HOME=/tmp
|
||||
echo "{}" > composer.json
|
||||
composer config --no-interaction allow-plugins.bamarni/composer-bin-plugin true
|
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
vendor/
|
||||
composer.*
|
5
.php-cs-fixer.php
Normal file
5
.php-cs-fixer.php
Normal file
|
@ -0,0 +1,5 @@
|
|||
<?php
|
||||
|
||||
return (new PhpCsFixer\Config())
|
||||
->setParallelConfig(PhpCsFixer\Runner\Parallel\ParallelConfigFactory::detect())
|
||||
;
|
10
shaargem.php
10
shaargem.php
|
@ -61,8 +61,8 @@ function shaargem_init($conf)
|
|||
function hook_shaargem_render_editlink($data)
|
||||
{
|
||||
// fetch title only for gemini:// iris
|
||||
if(isset($data['link']['url'])) {
|
||||
if(strstr($data['link']['url'], "gemini://")) {
|
||||
if (isset($data['link']['url'])) {
|
||||
if (strstr($data['link']['url'], "gemini://")) {
|
||||
if ($data['link']['title'] == '') {
|
||||
$data['link']['title'] = fetch_iri_title($data['link']['url']);
|
||||
}
|
||||
|
@ -84,8 +84,8 @@ function hook_shaargem_render_editlink($data)
|
|||
function hook_shaargem_save_link($data)
|
||||
{
|
||||
// ugly hack to get scheme
|
||||
if(isset($_POST['lf_url'])) {
|
||||
if(strstr($_POST['lf_url'], "gemini://")) {
|
||||
if (isset($_POST['lf_url'])) {
|
||||
if (strstr($_POST['lf_url'], "gemini://")) {
|
||||
$new_url = str_replace("http://", "gemini://", $data['url']);
|
||||
$data['url'] = $new_url;
|
||||
}
|
||||
|
@ -161,7 +161,7 @@ function fetch_iri_title($iri)
|
|||
// status 2x ok
|
||||
elseif ($status[0] == 2) {
|
||||
$nblines = 1;
|
||||
while($line = fgets($fp)) {
|
||||
while ($line = fgets($fp)) {
|
||||
$ret = preg_match(",# (.*),", $line, $title);
|
||||
if ($title[0] or $nblines > 100) {
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue