Browse Source

allow only mp-syndicate-to and syndicate-to

pull/82/head
Aaron Parecki 8 years ago
parent
commit
d376dac11c
No known key found for this signature in database GPG Key ID: 276C2817346D6056
  1. 6
      controllers/controllers.php
  2. 7
      views/settings.php

6
controllers/controllers.php

@ -324,8 +324,10 @@ $app->post('/settings/save', function() use($app) {
if(array_key_exists('slug_field', $params) && $params['slug_field'])
$user->micropub_slug_field = $params['slug_field'];
if(array_key_exists('syndicate_field', $params) && $params['syndicate_field'])
$user->micropub_syndicate_field = $params['syndicate_field'];
if(array_key_exists('syndicate_field', $params) && $params['syndicate_field']) {
if(in_array($params['syndicate_field'], ['syndicate-to','mp-syndicate-to']))
$user->micropub_syndicate_field = $params['syndicate_field'];
}
$user->save();
$app->response()['Content-type'] = 'application/json';

7
views/settings.php

@ -48,7 +48,12 @@
<tr>
<td>Syndication</td>
<td>
<div style="margin-bottom:4px;"><input type="text" id="syndicate-to-field-name" value="<?= $this->user->micropub_syndicate_field ?>" placeholder="mp-syndicate-to" class="form-control"></div>
<div style="margin-bottom:4px;">
<select id="syndicate-to-field-name">
<option value="mp-syndicate-to" <?= $this->user->micropub_syndicate_field == 'mp-syndicate-to' ? 'selected="selected"' : '' ?>>mp-syndicate-to</option>
<option value="syndicate-to" <?= $this->user->micropub_syndicate_field == 'syndicate-to' ? 'selected="selected"' : '' ?>>syndicate-to</option>
</select>
</div>
<div><input type="button" class="btn btn-primary" value="Save" id="save-syndicate-to-field"></div>
</td>
<td>Choose the name of the field that the syndication values will be sent in. This should be set to <code>mp-syndicate-to</code> unless your endpoint is using the deprecated <code>syndicate-to</code> property.</td>

Loading…
Cancel
Save