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

(ocmod) Path cannot start with brace e.g. {admin,catalog}/ not allowed #2561

Closed
tarranjones opened this issue Jan 14, 2015 · 5 comments
Closed

Comments

@tarranjones
Copy link

I've done a quick but ugly fix to admin/controller/extensions/modification.php.
The $file variable is overwritten during the loop so ideally that would need renaming throughout.

    $files = $dom->getElementsByTagName('modification')->item(0)->getElementsByTagName('file');

    foreach ($files as $file) {
        $operations = $file->getElementsByTagName('operation');  

        $file_tag = $file;
        $parts = explode('/', $file->getAttribute('path') ,2);
        foreach (explode(',',str_replace(array('{','}'),'', $parts[0])) as $key => $dir) {
            $file = $file_tag;
            $file->setAttribute('path', $dir . '/' . $parts[1]);

            /* current code */

        }
    }
    // Log
    $log[] = '----------------------------------------------------------------';        
@rmullaney77
Copy link

can't you just use path="./{admin,catalog}/"? untested, but should work since ./represents the current folder.

@tarranjones
Copy link
Author

the current code makes sure the path starts with 'system','catalog', or 'admin e.g

       if (substr($file->getAttribute('path'), 0, 7) == 'catalog') 

@rmullaney77
Copy link

ah ok, sorry

danielkerr added a commit that referenced this issue Jan 27, 2015
also removed the braces flag in the glob function
@tarranjones
Copy link
Author

Quick question:
Will this now work?

 <file path="{admin,catalog}/language/english/default.php"> 

Quick answer:
Yes or No ?

I don't want to waste anyone's time but I have looked at the commits and I cannot see how the issue is fixed. I don't need an explanation I just wont to make sure the correct issue had been closed as the first commit doesn't seem to relate to this issue at all.
@rmullaney77 @danielkerr

@shpe11
Copy link

shpe11 commented Mar 23, 2023

there is a simple fix:
<file path="admin/../{admin,catalog}/language/english/default.php">
verified, and works on 3.0.2.0

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

No branches or pull requests

4 participants