O shit, and the screenshot I sent was the wrong one, the correct one looked all the same but all slashes instead of backslashes!!! I already deleted it… Can you trust me ;-)
Best
.r.
> On 1. Aug 2020, at 22:40, Rainer Schuetz <rs...@ba...> wrote:
>
> I fear the urlencode stuff has to be rethought for consistent use with slash. The image at the end of that page doesn’t open atm - it used to in the past..
>
> Best
> .r.
>
>> On 1. Aug 2020, at 22:30, Rainer Schuetz <rs...@ba... <mailto:rs...@ba...>> wrote:
>>
>> I sent an email with attachments and the ml-server blocked again, I resend with text only for the big image:
>>
>>> On 1. Aug 2020, at 22:24, Rainer Schuetz <rs...@ba... <mailto:rs...@ba...>> wrote:
>>>
>>>
>>>
>>>> On 1. Aug 2020, at 21:07, Bernard Bel <ber...@gm... <mailto:ber...@gm...>> wrote:
>>>>
>>>> Well… At the moment I used DIRECTORY_SEPARATOR everywhere, but I don't understand where it should be used and where plain slashes are necessay! There seems to be no relevant documentation on this topic…
>>>
>>> I can’t claim understanding, but as an input to be considered: when php speaks with the system, it seems to use or receive backslash. The whole backslash thingy entered the picture because you used that document root and getcwd() in the beginning. I continued using getcwd() and didn’t think about how subsequent operations would handle this. I took for granted that php would know when it “speaks to the web” and converts backslashes it got from “speaking to windows” to slashes once it outputs stuff. That was wrong, but I also didn’t follow how you designed the paths you would be using when you made php “speak to the web”/generate html. I guess once they’re declared variables, they’re strings and php doesn’t think about converting them any more.
>>>
>>>
>>>> Maybe normal slashes everywhere would do the job?
>>>
>>> Yes! But what you did with “define SLASH /“ wasn’t enough, because the “bp_xyz” variables I suggested still receive backslashes from getcwd(), and you seem still to use those ones as well. Also - what I had to learn the hard way - unlike variable declarations a subsequent “define” seems not to override a preceding one - it has to be commented out. To get all over slashes I did a quick and clumsy replace for each individual variable following your model for “root”, and then everything flipped - and the links work!!! Windows even plays the MIDI-file without any MIDI-configuration on my part!!! With these settings the test links worked on Windows (I just tried two or three):
>>>
>>> <Screenshot 2020-08-01 at 22.20.50.png>
>>
>>
>> // define('SLASH',DIRECTORY_SEPARATOR);
>> define('SLASH',"/");
>>
>> $root = $_SERVER['DOCUMENT_ROOT'].SLASH;
>> $root = str_replace("\\",SLASH,$root);
>> $root = str_replace(SLASH,SLASH,$root);
>>
>> // take bottom-up approach
>> $bp_php_path = getcwd();
>> $bp_application_path = dirname($bp_php_path);
>> $bp_parent_path = dirname($bp_application_path);
>>
>> $bp_home_dir = str_replace($bp_parent_path.SLASH,'',$bp_application_path);
>> $part_dir = str_replace($bp_parent_path,'',$bp_php_path);
>> $path_above = str_replace($root,'',$bp_php_path);
>> $path_above = str_replace($part_dir,'',$path_above);
>>
>>
>> $bp_php_path = str_replace("\\",SLASH,$bp_php_path);
>> $bp_application_path = str_replace("\\",SLASH,$bp_application_path);
>> $bp_parent_path = str_replace("\\",SLASH,$bp_parent_path);
>> $bp_home_dir = str_replace("\\",SLASH,$bp_home_dir);
>> $part_dir = str_replace("\\",SLASH,$part_dir);
>> $path_above = str_replace("\\",SLASH,$path_above);
>>
>>
>> if(isset($_GET['path'])) $path = urldecode($_GET['path']);
>> else $path = '';
>>
>> $text_help_file = $bp_application_path.SLASH."BP2_help.txt";
>>
>> // $test = FALSE;
>> $test = TRUE;
>> if($test) {
>> echo "SHIT”; // is my test string for verifying something has changed, sorry ;-)
>> echo SLASH;
>> echo "<small>”;
>> ….
>>
>>> <Screenshot 2020-08-01 at 21.32.19.png>
>>
>> <Screenshot 2020-08-01 at 21.32.19.png>
>>
>>
>>
>>
>>>> I have just done one thing and uploaded the files: using a constant "SLASH" that can be defined either as DIRECTORY_SEPARATOR or as "/" in the beginning of _basic_tasks.php. So you quickly check whether classical slashes work… ;-)
>>>
>>> It wasn’t quick for me ;-) but worth it!
>>>
>>> Best
>>> .r.
>>>
>>> PS: I haven’t committed that last version yet. I’ll wait for your final version!
>>>
>>>
>>>> Bernard
>>>>
>>>> Rainer Schuetz wrote on 01/08/2020 20:16:
>>>>> Dear Bernard,
>>>>>
>>>>> Yes, this looks like serious progress. I can’t check seriously, no time, sorry. But I went to that “one” link. The wrong concatenation of absolute path problem is gone! Yey, a well assembled relative link! But the backslashes are still swallowed. Php still writes a link-segment with Windows/backslash syntax to a html-source tag, and as a result all \ are swallowed:
>>>>>
>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> bolprocessor-devel mailing list
>>>> bol...@li... <mailto:bol...@li...>
>>>> https://lists.sourceforge.net/lists/listinfo/bolprocessor-devel <https://lists.sourceforge.net/lists/listinfo/bolprocessor-devel>
|