Closed bobbingwide closed 4 years ago
Remove the generated posts from the API reference.
I added a folder with a space to foobar and got this when parsing
File:11,12,space,space,11
Parsing file: space
Processing: space
File:12,12,dir/fileinspacedir.php,dir/fileinspacedir.php,11
Parsing file: fileinspacedir
Processing: dir/fileinspacedir.php
Processing file: foobar,dir/fileinspacedir.php
Continue to process file? ( y=yes/n=no/s=skip/g=go/q=quit )
Processing: dir/fileinspacedir.php, foobar, plugin
<p>Creating file: dir/fileinspacedir.php</p><p>Creating file: dir</p>
Warning: file(C:\apache\htdocs\oikcom/wp-content/plugins/foobar/dir/fileinspacedir.php): failed to open stream: No such file or directory in C:\apache\htdocs\wordpress\wp-content\plugins\oik-shortcodes\classes\oik-listapis2.php on line 131
Warning: file(C:\apache\htdocs\oikcom/wp-content/plugins/foobar/dir/fileinspacedir.php): failed to open stream: No such file or directory in C:\apache\htdocs\wordpress\wp-content\plugins\oik-shortcodes\classes\oik-listapis2.php on line 131
Warning: Invalid argument supplied for foreach() in C:\apache\htdocs\wordpress\wp-content\plugins\oik-shortcodes\admin\oik-files.php on line 11
Warning: Invalid argument supplied for foreach() in C:\apache\htdocs\wordpress\wp-content\plugins\oik-shortcodes\classes\class-oiksc-file-loader.php on line 70
<div id="error"><p class="wpdberror"><strong>WordPress database error:</strong> [Column 'post_content' cannot be null]<br /><code>INSERT INTO `wp_posts` (`post_author`, `post_date`, `post_date_gmt`, `post_content`, `post_content_filtered`, `post_title`, `post_excerpt`, `post_status`, `post_type`, `comment_status`, `ping_status`, `post_password`, `post_name`, `to_ping`, `pinged`, `post_modified`, `post_modified_gmt`, `post_parent`, `menu_order`, `post_mime_type`, `guid`) VALUES (0, '2019-12-27 17:31:06', '2019-12-27 17:31:06', NULL, '', 'Parsed: 43692', '', 'publish', 'oik_parsed_source', 'closed', 'closed', '', 'parsed-43692', '', '', '2019-12-27 17:31:06', '2019-12-27 17:31:06', 0, 0, '', '')</code></p></div>
Processing file: foobar,dir/fileinspacedir.php ended
Processing valid: foobar dir/fileinspacedir.php plugin
Warning: file(C:\apache\htdocs\oikcom/wp-content/plugins/foobar/dir/fileinspacedir.php): failed to open stream: No such file or directory in C:\apache\htdocs\wordpress\wp-content\plugins\oik-shortcodes\classes\oik-listapis2.php on line 131
Warning: Invalid argument supplied for foreach() in C:\apache\htdocs\wordpress\wp-content\plugins\oik-shortcodes\admin\oik-create-apis.php on line 310
The problem is caused by the logic that converts the result of a Git command into separate lines. It was splitting on blanks, having previously converted tabs, CR’s and LFs to blanks. This logic is in oik-batch’s ‘lib/class-git.php’
In the PHPUnit tests for WordPress there are a couple of files in the data directory
Two file entries are erroneously created for:
spaces
andspaces/index.php
Note: The source file is rubbish anyway. It just contains one line:
<?php