]> git.mjollnir.org Git - moodle.git/commitdiff
Fixed accessing the first character from string{0} to string[0]
authormudrd8mz <mudrd8mz>
Mon, 3 Aug 2009 10:54:29 +0000 (10:54 +0000)
committermudrd8mz <mudrd8mz>
Mon, 3 Aug 2009 10:54:29 +0000 (10:54 +0000)
"...Strings may also be accessed using braces, as in $str{42}, for the same
purpose. However, this syntax is deprecated as of PHP 6. Use square brackets
instead." (http://cz2.php.net/manual/en/language.types.string.php)

pluginfile.php

index 7a5bf6e80c59d9a2d65a99dd2c5b4f7ed7947f0d..1585040e6e2a57865118e90a27e16b6a96a3fcb9 100644 (file)
@@ -36,7 +36,7 @@ $forcedownload = optional_param('forcedownload', 0, PARAM_BOOL);
 // relative path must start with '/'
 if (!$relativepath) {
     print_error('invalidargorconf');
-} else if ($relativepath{0} != '/') {
+} else if ($relativepath[0] != '/') {
     print_error('pathdoesnotstartslash');
 }