Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add mkdir function when symlink is created #14

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions includes/lib/class-easy-symlinks-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,10 @@ public function save_symlinks() {
// successfully add
// fail error.
$value = $destination . ' -> ' . $source;
// Get the target folder name.
preg_match( '/^.\/uploads\/\W?\K.*/', $target, $matches );
// Create target folder under uploads folder.
mkdir( $homepath . '/wp-content/uploads/' . $matches[0], 0777, true );
Copy link
Member

Choose a reason for hiding this comment

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

@umandalroald

This creates a folder
./uploads/cache if link is from /wp-content/cache

This seems to fail:
./wp-content/uploads/rootfolder if link is from /rootfolder


if ( $original_list ) {
$new = array_push( $original_list, $value );
Expand Down