Skip to content

Conversation

@sekedus
Copy link
Contributor

@sekedus sekedus commented Dec 13, 2023

  • Image css max-width:300px;
  • Cache value = 0

background-color: #fff;
}

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you using an EditorConfig plugin in your IDE?

$url = @$_POST['url'] ?: @$_GET['url'];
$sel = @$_POST['sel'] ?: @$_GET['sel'];
$go = @$_POST['go'] ?: @$_GET['go'];
$ch = @$_POST['ch'] ?: @$_GET['ch'];
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$_GET['ch'] allow to save the state in the URL and preserve it during refreshes. Maybe not a big deal for the cache expires, but I'd prefer to have consistency over all variables.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Eg. http://localhost:8074/playground.php?url=http://duzun.me&sel=a%20img:parent&ch=10.

<p><label>URL: <input type="url" name="url" value="<?=htmlspecialchars(@$url??'', ENT_QUOTES);?>" placeholder="e.g. https://mariauzun.com/portfolio" autofocus class="form-control" required /></label></p>
<p><label>Selector: <input type="text" name="sel" value="<?=htmlspecialchars(@$sel??'', ENT_QUOTES);?>" placeholder="e.g. 'a[href] &gt; img[src]:parent'" class="form-control" required /></label></p>
<p><label>Cache: <input type="number" name="ch" value="<?=$_POST['ch']>=0?@$_POST['ch']:1800;?>" min="0" max="3600" placeholder="e.g. 1800" class="form-control" /> (seconds)</label></p>
<p><label>Cache: <input type="number" name="ch" value="<?=$_POST['ch']==='0'||(int)$_POST['ch']>0?@$_POST['ch']:'';?>" min="0" max="3600" placeholder="e.g. 600" class="form-control" /> (seconds) <code>default: 3600</code></label></p>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line repeats the logic for ch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants