Update redirects.php
This commit is contained in:
parent
d881875827
commit
3ae0912a3a
|
@ -2,6 +2,8 @@
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
$csv = 'redirects.csv';
|
||||||
|
|
||||||
$template = <<<EOS
|
$template = <<<EOS
|
||||||
---
|
---
|
||||||
layout: redirect
|
layout: redirect
|
||||||
|
@ -10,12 +12,9 @@ destination: %DESTINATION%
|
||||||
|
|
||||||
EOS;
|
EOS;
|
||||||
|
|
||||||
$filename = dirname(__FILE__) . '/redirects.csv';
|
|
||||||
|
|
||||||
$row = 0;
|
$row = 0;
|
||||||
|
if (($handle = fopen($csv, 'r')) !== FALSE) {
|
||||||
if (($handle = fopen($filename, 'r')) !== FALSE) {
|
while (($data = fgetcsv($handle, filesize($csv))) !== FALSE) {
|
||||||
while (($data = fgetcsv($handle, filesize($filename))) !== FALSE) {
|
|
||||||
$row++;
|
$row++;
|
||||||
|
|
||||||
if ($row > 1) {
|
if ($row > 1) {
|
||||||
|
|
Reference in a new issue